diff options
author | Rémi Garde <remi.garde@free.fr> | 2018-07-23 18:48:27 +0200 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-07-23 16:48:27 +0000 |
commit | d25134bc6b8b13d5ff550c950c65b6e9c4a7a267 (patch) | |
tree | 1742ed9d0613b018d147e54055da7dd2c518430d /src/term/color.rs | |
parent | ea512cb0f3cb159707eb29fdbf2e31bbb1c1b902 (diff) | |
download | r-alacritty-d25134bc6b8b13d5ff550c950c65b6e9c4a7a267.tar.gz r-alacritty-d25134bc6b8b13d5ff550c950c65b6e9c4a7a267.tar.bz2 r-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/term/color.rs')
-rw-r--r-- | src/term/color.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/term/color.rs b/src/term/color.rs index b84f11bd..6acd092a 100644 --- a/src/term/color.rs +++ b/src/term/color.rs @@ -4,7 +4,7 @@ use std::fmt; use {Rgb, ansi}; use config::Colors; -pub const COUNT: usize = 269; +pub const COUNT: usize = 270; /// List of indexed colors /// @@ -13,7 +13,7 @@ pub const COUNT: usize = 269; /// the configured foreground color, item 257 is the configured background /// color, item 258 is the cursor foreground color, item 259 is the cursor /// background color. Following that are 8 positions for dim colors. -/// Item 268 is the bright foreground color. +/// Item 268 is the bright foreground color, 269 the dim foreground. #[derive(Copy, Clone)] pub struct List([Rgb; COUNT]); @@ -65,6 +65,10 @@ impl List { self[ansi::NamedColor::Cursor] = colors.cursor.cursor; // Dims + self[ansi::NamedColor::DimForeground] = colors + .primary + .dim_foreground + .unwrap_or(colors.primary.foreground * 0.66); match colors.dim { Some(ref dim) => { trace!("Using config-provided dim colors"); |