From 46d4de7ad2f71c4a36c42e6186cf772d4267ad03 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 30 May 2021 08:13:33 -0700 Subject: [PATCH] mux: make tardy/greyed out palette less jarring Use a similar hsv transformation to that used to dim inactive panes instead of the treatment that made the black look grey, which felt like a flash instead of a dim. --- term/src/color.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/term/src/color.rs b/term/src/color.rs index 7433e2b35..e735efbb1 100644 --- a/term/src/color.rs +++ b/term/src/color.rs @@ -35,15 +35,15 @@ pub struct ColorPalette { /// This is not defined on RgbColor itself in order /// to avoid termwiz requiring a dep on the palette crate. fn grey_out(color: RgbColor) -> RgbColor { - use palette::{Blend, Lch, Saturate, Srgba}; + use palette::{Lch, Saturate, Srgba}; let color = Srgba::new(color.red, color.green, color.blue, 0xff); let color: Srgba = color.into_format(); let color = color.into_linear(); - let desaturated = Lch::from(color).desaturate(0.2); + let mut desaturated = Lch::from(color).desaturate(0.2); + desaturated.l *= 0.8; - let tint = Srgba::new(0.2, 0.2, 0.2, 0.6).into_linear(); - let result = Srgba::from_linear(tint.over(desaturated.into())); + let result = Srgba::from_linear(desaturated.into()); let result = Srgba::::from_format(result); RgbColor::new(result.red, result.green, result.blue)