summaryrefslogtreecommitdiff
path: root/alacritty_terminal
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2020-04-09 04:02:10 +0300
committerGitHub <noreply@github.com>2020-04-09 04:02:10 +0300
commit2fc5120327c6eb096154214faec5dc4e1dee2253 (patch)
treec7e6a03051949624bcb04501af2a1d7e6246288a /alacritty_terminal
parent13eb50de799c4c6f7ebed1a7fa1ab25b378580bb (diff)
downloadalacritty-2fc5120327c6eb096154214faec5dc4e1dee2253.tar.gz
alacritty-2fc5120327c6eb096154214faec5dc4e1dee2253.zip
Use config colors to theme Wayland decorations
Fixes #2092.
Diffstat (limited to 'alacritty_terminal')
-rw-r--r--alacritty_terminal/src/term/color.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/alacritty_terminal/src/term/color.rs b/alacritty_terminal/src/term/color.rs
index b452245e..f9d7cf3a 100644
--- a/alacritty_terminal/src/term/color.rs
+++ b/alacritty_terminal/src/term/color.rs
@@ -11,6 +11,9 @@ use crate::config::{Colors, LOG_TARGET_CONFIG};
pub const COUNT: usize = 269;
+/// Factor for automatic computation of dim colors used by terminal.
+pub const DIM_FACTOR: f32 = 0.66;
+
pub const RED: Rgb = Rgb { r: 0xff, g: 0x0, b: 0x0 };
pub const YELLOW: Rgb = Rgb { r: 0xff, g: 0xff, b: 0x0 };
@@ -181,7 +184,7 @@ impl List {
// Dims
self[ansi::NamedColor::DimForeground] =
- colors.primary.dim_foreground.unwrap_or(colors.primary.foreground * 0.66);
+ colors.primary.dim_foreground.unwrap_or(colors.primary.foreground * DIM_FACTOR);
match colors.dim {
Some(ref dim) => {
trace!("Using config-provided dim colors");
@@ -196,14 +199,14 @@ impl List {
},
None => {
trace!("Deriving dim colors from normal colors");
- self[ansi::NamedColor::DimBlack] = colors.normal().black * 0.66;
- self[ansi::NamedColor::DimRed] = colors.normal().red * 0.66;
- self[ansi::NamedColor::DimGreen] = colors.normal().green * 0.66;
- self[ansi::NamedColor::DimYellow] = colors.normal().yellow * 0.66;
- self[ansi::NamedColor::DimBlue] = colors.normal().blue * 0.66;
- self[ansi::NamedColor::DimMagenta] = colors.normal().magenta * 0.66;
- self[ansi::NamedColor::DimCyan] = colors.normal().cyan * 0.66;
- self[ansi::NamedColor::DimWhite] = colors.normal().white * 0.66;
+ self[ansi::NamedColor::DimBlack] = colors.normal().black * DIM_FACTOR;
+ self[ansi::NamedColor::DimRed] = colors.normal().red * DIM_FACTOR;
+ self[ansi::NamedColor::DimGreen] = colors.normal().green * DIM_FACTOR;
+ self[ansi::NamedColor::DimYellow] = colors.normal().yellow * DIM_FACTOR;
+ self[ansi::NamedColor::DimBlue] = colors.normal().blue * DIM_FACTOR;
+ self[ansi::NamedColor::DimMagenta] = colors.normal().magenta * DIM_FACTOR;
+ self[ansi::NamedColor::DimCyan] = colors.normal().cyan * DIM_FACTOR;
+ self[ansi::NamedColor::DimWhite] = colors.normal().white * DIM_FACTOR;
},
}
}