1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00

Fix foreground dimming with truecolor text

Fixes #3766.
This commit is contained in:
Carlo Abelli 2020-06-28 20:07:16 -04:00 committed by GitHub
parent 341832f820
commit 8688e47ddb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Display not scrolling when printing new lines while scrolled in history - Display not scrolling when printing new lines while scrolled in history
- Regression in font rendering on macOS - Regression in font rendering on macOS
- Scroll down escape (`CSI Ps T`) incorrectly pulling lines from history - Scroll down escape (`CSI Ps T`) incorrectly pulling lines from history
- Dim escape (`CSI 2 m`) support for truecolor text
## 0.4.3 ## 0.4.3

View file

@ -21,7 +21,7 @@ use crate::grid::{
use crate::index::{self, Column, IndexRange, Line, Point, Side}; use crate::index::{self, Column, IndexRange, Line, Point, Side};
use crate::selection::{Selection, SelectionRange}; use crate::selection::{Selection, SelectionRange};
use crate::term::cell::{Cell, Flags, LineLength}; 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}; use crate::vi_mode::{ViModeCursor, ViMotion};
pub mod cell; 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 { fn compute_fg_rgb<C>(config: &Config<C>, colors: &color::List, fg: Color, flags: Flags) -> Rgb {
match fg { match fg {
Color::Spec(rgb) => rgb, Color::Spec(rgb) => match flags & Flags::DIM {
Flags::DIM => rgb * DIM_FACTOR,
_ => rgb,
},
Color::Named(ansi) => { Color::Named(ansi) => {
match (config.draw_bold_text_with_bright_colors(), flags & Flags::DIM_BOLD) { 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. // If no bright foreground is set, treat it like the BOLD flag doesn't exist.