summaryrefslogtreecommitdiffstats
path: root/alacritty_terminal
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-12-05 09:03:03 +0000
committerGitHub <noreply@github.com>2020-12-05 12:03:03 +0300
commit9e71002e40d5487c6fa2571a3a3c4f5c8f679334 (patch)
tree4704bcd1029b0b236967e1ffc8be49e36a235440 /alacritty_terminal
parentde9ed259667588285891eda1665cd3edefcd3297 (diff)
Fix dimming of indexed colors
It seems like the list of colors might have changed a bit, leading to indexed colors not being transformed into their dim colors correctly. To prevent this from happening in the future, the dimming for colors in the range '0..=7' is now performed by offsetting them from the 'NamedColor::DimBlack'. Since this is the first dimmed color, this should always work as long as all dimmed colors are added in the correct order.
Diffstat (limited to 'alacritty_terminal')
-rw-r--r--alacritty_terminal/src/term/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs
index b9e21205..154a24a2 100644
--- a/alacritty_terminal/src/term/mod.rs
+++ b/alacritty_terminal/src/term/mod.rs
@@ -401,7 +401,7 @@ impl RenderableCell {
) {
(true, Flags::BOLD, 0..=7) => idx as usize + 8,
(false, Flags::DIM, 8..=15) => idx as usize - 8,
- (false, Flags::DIM, 0..=7) => idx as usize + 260,
+ (false, Flags::DIM, 0..=7) => NamedColor::DimBlack as usize + idx as usize,
_ => idx as usize,
};