From 35e4f2096a388a0043decddbd1a0ad94a2278e71 Mon Sep 17 00:00:00 2001 From: DarkDefender Date: Mon, 19 Jun 2017 02:04:16 +0200 Subject: Fix bright inverse colors (#621) Fixes #611. --- src/term/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/term/mod.rs') diff --git a/src/term/mod.rs b/src/term/mod.rs index 6cbd07d7..bbc3f1aa 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -309,12 +309,12 @@ impl<'a> Iterator for RenderableCellsIter<'a> { (*cell, selected) }; - // `Color` fg, bg - let (fg, bg) = cell.colors(selected); - - // `Rgb` fg, bg - let fg = self.compute_fg_rgb(fg, &cell); - let bg = self.compute_bg_rgb(bg); + // Apply inversion and lookup RGB values + let (fg, bg) = if selected || cell.inverse() { + (self.compute_bg_rgb(&cell.bg), self.compute_fg_rgb(&cell.fg, &cell)) + } else { + (self.compute_fg_rgb(&cell.fg, &cell), self.compute_bg_rgb(&cell.bg)) + }; return Some(RenderableCell { line: line, -- cgit v1.2.3-54-g00ecf