diff options
Diffstat (limited to 'src/term/cell.rs')
-rw-r--r-- | src/term/cell.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/term/cell.rs b/src/term/cell.rs index 98d46bf2..18e03dee 100644 --- a/src/term/cell.rs +++ b/src/term/cell.rs @@ -77,6 +77,10 @@ impl Cell { self.flags.contains(BOLD) } + pub fn inverse(&self) -> bool { + self.flags.contains(INVERSE) + } + pub fn new(c: char, fg: Color, bg: Color) -> Cell { Cell { c: c.into(), @@ -86,17 +90,6 @@ impl Cell { } } - /// Get foreground and background colors adjusted for INVERSE flag - /// - /// First color is the foreground, second color is the background. - pub fn colors(&self, force_invert: bool) -> (&Color, &Color) { - if self.flags.contains(INVERSE) || force_invert { - (&self.bg, &self.fg) - } else { - (&self.fg, &self.bg) - } - } - #[inline] pub fn is_empty(&self) -> bool { self.c == ' ' && |