diff options
author | Joe Wilm <joe@jwilm.com> | 2016-12-04 11:14:27 -0800 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-12-11 20:23:41 -0800 |
commit | 23e36f19255db60084c2c240a166d137f6c12c3e (patch) | |
tree | 8f37cb27e0c9ed218e26bddc691b3ae15824e50e /src/term/cell.rs | |
parent | 3151ef862596bbfc69b2941765f2574348d85a8f (diff) | |
download | alacritty-23e36f19255db60084c2c240a166d137f6c12c3e.tar.gz alacritty-23e36f19255db60084c2c240a166d137f6c12c3e.zip |
Add support for indexed colors
ANSI escape sequences like `\x1b[48;5;10m` were not supported until now.
Specifically, the second attribute, 5, says that the following attribute
is a color index.
The ref tests were updated since `enum Color` variants changed.
Diffstat (limited to 'src/term/cell.rs')
-rw-r--r-- | src/term/cell.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/term/cell.rs b/src/term/cell.rs index 506fde0e..df648294 100644 --- a/src/term/cell.rs +++ b/src/term/cell.rs @@ -15,8 +15,7 @@ use std::mem; -use ansi; -use Rgb; +use ansi::{NamedColor, Color}; bitflags! { #[derive(Serialize, Deserialize)] @@ -28,12 +27,6 @@ bitflags! { } } -#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum Color { - Rgb(Rgb), - Ansi(ansi::Color), -} - #[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] pub struct Cell { pub c: char, @@ -59,7 +52,7 @@ impl Cell { #[inline] pub fn is_empty(&self) -> bool { self.c == ' ' && - self.bg == Color::Ansi(ansi::Color::Background) && + self.bg == Color::Named(NamedColor::Background) && !self.flags.contains(INVERSE) } |