@@ -8,10 +8,8 @@ use ratatui::style::Style;
88use ratatui:: text:: Span ;
99
1010use crate :: color:: blend;
11+ use crate :: terminal_palette:: default_bg;
1112use crate :: terminal_palette:: default_fg;
12- use crate :: terminal_palette:: terminal_palette;
13-
14- const FALLBACK_DARK_GRAY : ( u8 , u8 , u8 ) = ( 103 , 103 , 103 ) ;
1513
1614static PROCESS_START : OnceLock < Instant > = OnceLock :: new ( ) ;
1715
@@ -35,11 +33,11 @@ pub(crate) fn shimmer_spans(text: &str) -> Vec<Span<'static>> {
3533 let has_true_color = supports_color:: on_cached ( supports_color:: Stream :: Stdout )
3634 . map ( |level| level. has_16m )
3735 . unwrap_or ( false ) ;
38- let band_half_width = 3 .0;
36+ let band_half_width = 5 .0;
3937
4038 let mut spans: Vec < Span < ' static > > = Vec :: with_capacity ( chars. len ( ) ) ;
41- let default_fg = default_fg ( ) ;
42- let palette_dark_gray = terminal_palette ( ) . map ( |palette| palette [ 8 ] ) ;
39+ let base_color = default_fg ( ) . unwrap_or ( ( 128 , 128 , 128 ) ) ;
40+ let highlight_color = default_bg ( ) . unwrap_or ( ( 255 , 255 , 255 ) ) ;
4341 for ( i, ch) in chars. iter ( ) . enumerate ( ) {
4442 let i_pos = i as isize + padding as isize ;
4543 let pos = pos as isize ;
@@ -52,11 +50,8 @@ pub(crate) fn shimmer_spans(text: &str) -> Vec<Span<'static>> {
5250 0.0
5351 } ;
5452 let style = if has_true_color {
55- let base = palette_dark_gray
56- . or ( default_fg)
57- . unwrap_or ( FALLBACK_DARK_GRAY ) ;
5853 let highlight = t. clamp ( 0.0 , 1.0 ) ;
59- let ( r, g, b) = blend ( ( 255 , 255 , 255 ) , base , highlight ) ;
54+ let ( r, g, b) = blend ( highlight_color , base_color , highlight * 0.9 ) ;
6055 // Allow custom RGB colors, as the implementation is thoughtfully
6156 // adjusting the level of the default foreground color.
6257 #[ allow( clippy:: disallowed_methods) ]
0 commit comments