From b4a839aee9784a2d281be1bec87ac6f2ae4a79f0 Mon Sep 17 00:00:00 2001 From: Jake Merdich Date: Fri, 23 Jun 2017 10:01:53 -0700 Subject: Add dim color support Add support for the VTE 'dim' flag, with additional support for custom-themed dim colors. If no color is specified in the config, it will default to 2/3 the previous (not a spec, but the value other terminals seem to use). The actual dimming behavior brings bright colors to normal and regular colors to the new dim ones. Custom RGB values are not changed, nor are non-named indexed colors. --- src/term/cell.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/term/cell.rs') diff --git a/src/term/cell.rs b/src/term/cell.rs index 18e03dee..d1c6877b 100644 --- a/src/term/cell.rs +++ b/src/term/cell.rs @@ -25,6 +25,8 @@ bitflags! { const WRAPLINE = 0b00010000, const WIDE_CHAR = 0b00100000, const WIDE_CHAR_SPACER = 0b01000000, + const DIM = 0b10000000, + const DIM_BOLD = 0b10000010, } } @@ -73,14 +75,21 @@ impl LineLength for grid::Row { } impl Cell { + #[inline] pub fn bold(&self) -> bool { self.flags.contains(BOLD) } + #[inline] pub fn inverse(&self) -> bool { self.flags.contains(INVERSE) } + #[inline] + pub fn dim(&self) -> bool { + self.flags.contains(DIM) + } + pub fn new(c: char, fg: Color, bg: Color) -> Cell { Cell { c: c.into(), -- cgit v1.2.3-54-g00ecf