diff options
author | Carlo Abelli <carlo@abelli.me> | 2020-06-28 20:07:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-29 00:07:16 +0000 |
commit | 8688e47ddb932818d4e0992299c3cbbff6cf0572 (patch) | |
tree | f2fdd479a6598c675d327c12f6e057e7e13543d2 /alacritty_terminal | |
parent | 341832f820611e3d69e0213b7e0d63c9d7a0eb50 (diff) | |
download | alacritty-8688e47ddb932818d4e0992299c3cbbff6cf0572.tar.gz alacritty-8688e47ddb932818d4e0992299c3cbbff6cf0572.zip |
Fix foreground dimming with truecolor text
Fixes #3766.
Diffstat (limited to 'alacritty_terminal')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index d538a427..bed3f1bc 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -21,7 +21,7 @@ use crate::grid::{ use crate::index::{self, Column, IndexRange, Line, Point, Side}; use crate::selection::{Selection, SelectionRange}; use crate::term::cell::{Cell, Flags, LineLength}; -use crate::term::color::Rgb; +use crate::term::color::{Rgb, DIM_FACTOR}; use crate::vi_mode::{ViModeCursor, ViMotion}; pub mod cell; @@ -378,7 +378,10 @@ impl RenderableCell { fn compute_fg_rgb<C>(config: &Config<C>, colors: &color::List, fg: Color, flags: Flags) -> Rgb { match fg { - Color::Spec(rgb) => rgb, + Color::Spec(rgb) => match flags & Flags::DIM { + Flags::DIM => rgb * DIM_FACTOR, + _ => rgb, + }, Color::Named(ansi) => { match (config.draw_bold_text_with_bright_colors(), flags & Flags::DIM_BOLD) { // If no bright foreground is set, treat it like the BOLD flag doesn't exist. |