diff options
author | Anhad Singh <62820092+Andy-Python-Programmer@users.noreply.github.com> | 2023-05-24 06:35:58 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-23 20:35:58 +0000 |
commit | cb7ad5b7e6893787c2006cc8cb09fbbc4711c0f7 (patch) | |
tree | e8c5315bb620e6d4e1564dfd6825303b498a3d6d /alacritty/src/display/content.rs | |
parent | f0379f2da751e81ba05bbf65ecb5e59590f39be4 (diff) | |
download | r-alacritty-cb7ad5b7e6893787c2006cc8cb09fbbc4711c0f7.tar.gz r-alacritty-cb7ad5b7e6893787c2006cc8cb09fbbc4711c0f7.tar.bz2 r-alacritty-cb7ad5b7e6893787c2006cc8cb09fbbc4711c0f7.zip |
Switch to VTE's built-in ansi feature
Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty/src/display/content.rs')
-rw-r--r-- | alacritty/src/display/content.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/alacritty/src/display/content.rs b/alacritty/src/display/content.rs index ca49c01a..da211094 100644 --- a/alacritty/src/display/content.rs +++ b/alacritty/src/display/content.rs @@ -121,7 +121,7 @@ impl<'a> RenderableContent<'a> { let insufficient_contrast = (!matches!(cursor_color, CellRgb::Rgb(_)) || !matches!(text_color, CellRgb::Rgb(_))) - && cell.fg.contrast(cell.bg) < MIN_CURSOR_CONTRAST; + && cell.fg.contrast(*cell.bg) < MIN_CURSOR_CONTRAST; // Convert from cell colors to RGB. let mut text_color = text_color.color(cell.fg, cell.bg); @@ -307,8 +307,11 @@ impl RenderableCell { let config = &content.config; match fg { Color::Spec(rgb) => match flags & Flags::DIM { - Flags::DIM => rgb * DIM_FACTOR, - _ => rgb, + Flags::DIM => { + let rgb: Rgb = rgb.into(); + rgb * DIM_FACTOR + }, + _ => rgb.into(), }, Color::Named(ansi) => { match (config.draw_bold_text_with_bright_colors, flags & Flags::DIM_BOLD) { @@ -350,7 +353,7 @@ impl RenderableCell { #[inline] fn compute_bg_rgb(content: &mut RenderableContent<'_>, bg: Color) -> Rgb { match bg { - Color::Spec(rgb) => rgb, + Color::Spec(rgb) => rgb.into(), Color::Named(ansi) => content.color(ansi as usize), Color::Indexed(idx) => content.color(idx as usize), } |