From 5876b4bf7a88a59482aefcc85e04a9ef6ecfed74 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Sun, 23 Oct 2016 15:37:06 -0700 Subject: Proof of concept live reloading for colors The architecture here is really poor. Need to move file watching into a dedicated location and probably have an spmc broadcast queue. other modules besides rendering will care about config reloading in the future. --- src/ansi.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ansi.rs') diff --git a/src/ansi.rs b/src/ansi.rs index 45cc66f9..c419d7e5 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -337,6 +337,10 @@ pub enum Color { BrightCyan, /// Bright white BrightWhite, + /// The foreground color + Foreground, + /// The background color + Background, } /// Terminal character attributes @@ -384,10 +388,6 @@ pub enum Attr { Background(Color), /// Set specific background color BackgroundSpec(Rgb), - /// Set default foreground - DefaultForeground, - /// Set default background - DefaultBackground, } impl<'a, H: Handler + TermInfo + 'a> vte::Perform for Performer<'a, H> { @@ -584,7 +584,7 @@ impl<'a, H: Handler + TermInfo + 'a> vte::Perform for Performer<'a, H> { break; } }, - 39 => Attr::DefaultForeground, + 39 => Attr::Foreground(Color::Foreground), 40 => Attr::Background(Color::Black), 41 => Attr::Background(Color::Red), 42 => Attr::Background(Color::Green), @@ -600,7 +600,7 @@ impl<'a, H: Handler + TermInfo + 'a> vte::Perform for Performer<'a, H> { break; } }, - 49 => Attr::DefaultBackground, + 49 => Attr::Background(Color::Background), 90 => Attr::Foreground(Color::BrightBlack), 91 => Attr::Foreground(Color::BrightRed), 92 => Attr::Foreground(Color::BrightGreen), -- cgit