aboutsummaryrefslogtreecommitdiff
path: root/src/ansi.rs
diff options
context:
space:
mode:
authorRĂ©mi Garde <remi.garde@free.fr>2018-07-23 18:48:27 +0200
committerChristian Duerr <chrisduerr@users.noreply.github.com>2018-07-23 16:48:27 +0000
commitd25134bc6b8b13d5ff550c950c65b6e9c4a7a267 (patch)
tree1742ed9d0613b018d147e54055da7dd2c518430d /src/ansi.rs
parentea512cb0f3cb159707eb29fdbf2e31bbb1c1b902 (diff)
downloadalacritty-d25134bc6b8b13d5ff550c950c65b6e9c4a7a267.tar.gz
alacritty-d25134bc6b8b13d5ff550c950c65b6e9c4a7a267.zip
Add optional dim foreground color
Add optional color for the dim foreground (`\e[2m;`) Defaults to 2/3 of the foreground color. (same as other colors). If a bright color is dimmed, it's displayed as the normal color. The exception for this is when the bright foreground is dimmed when no bright foreground color is set. In that case it's treated as a normal foreground color and dimmed to DimForeground. To minimize the surprise for the user, the bright and dim colors have been completely removed from the default configuration file. Some documentation has also been added to make it clear to users what these options can be used for. This fixes #1448.
Diffstat (limited to 'src/ansi.rs')
-rw-r--r--src/ansi.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ansi.rs b/src/ansi.rs
index 726550a0..f1ca759a 100644
--- a/src/ansi.rs
+++ b/src/ansi.rs
@@ -560,6 +560,8 @@ pub enum NamedColor {
DimWhite,
/// The bright foreground color
BrightForeground,
+ /// Dim foreground
+ DimForeground,
}
impl NamedColor {
@@ -574,6 +576,7 @@ impl NamedColor {
NamedColor::Magenta => NamedColor::BrightMagenta,
NamedColor::Cyan => NamedColor::BrightCyan,
NamedColor::White => NamedColor::BrightWhite,
+ NamedColor::DimForeground => NamedColor::Foreground,
NamedColor::DimBlack => NamedColor::Black,
NamedColor::DimRed => NamedColor::Red,
NamedColor::DimGreen => NamedColor::Green,
@@ -596,6 +599,7 @@ impl NamedColor {
NamedColor::Magenta => NamedColor::DimMagenta,
NamedColor::Cyan => NamedColor::DimCyan,
NamedColor::White => NamedColor::DimWhite,
+ NamedColor::Foreground => NamedColor::DimForeground,
NamedColor::BrightBlack => NamedColor::Black,
NamedColor::BrightRed => NamedColor::Red,
NamedColor::BrightGreen => NamedColor::Green,
@@ -604,6 +608,7 @@ impl NamedColor {
NamedColor::BrightMagenta => NamedColor::Magenta,
NamedColor::BrightCyan => NamedColor::Cyan,
NamedColor::BrightWhite => NamedColor::White,
+ NamedColor::BrightForeground => NamedColor::Foreground,
val => val
}
}