aboutsummaryrefslogtreecommitdiff
path: root/src/term/cell.rs
diff options
context:
space:
mode:
authorJake Merdich <jake@merdich.com>2017-06-23 10:01:53 -0700
committerJoe Wilm <jwilm@users.noreply.github.com>2017-06-23 11:27:15 -0700
commitb4a839aee9784a2d281be1bec87ac6f2ae4a79f0 (patch)
tree19a72d9a8a80c472a5cc4bf431e769695b01a02c /src/term/cell.rs
parent0091d3cb99e69ffc946ab6bbf40530ff8694b246 (diff)
downloadalacritty-b4a839aee9784a2d281be1bec87ac6f2ae4a79f0.tar.gz
alacritty-b4a839aee9784a2d281be1bec87ac6f2ae4a79f0.zip
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.
Diffstat (limited to 'src/term/cell.rs')
-rw-r--r--src/term/cell.rs9
1 files changed, 9 insertions, 0 deletions
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<Cell> {
}
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(),