From 242e24eb4ad0da3f6ddae60617d35b5c4952b0a5 Mon Sep 17 00:00:00 2001 From: Timon Post Date: Tue, 8 Oct 2019 16:13:40 +0200 Subject: [PATCH 1/4] 1 --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 757d8a0..41ee248 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -241,7 +241,8 @@ impl TerminalColor { pub fn new() -> TerminalColor { #[cfg(windows)] let color = if supports_ansi() { - Box::from(AnsiColor::new()) as Box<(dyn Style + Sync + Send)> + let a= Box::from(AnsiColor::new()) as Box<(dyn Style + Sync + Send)>; + WinApiColor::new() as Box<(dyn Style + Sync + Send)> } else { WinApiColor::new() as Box<(dyn Style + Sync + Send)> }; From 69e9c14183af38ac1cfc457af8ecd37c26c4a892 Mon Sep 17 00:00:00 2001 From: Timon Post Date: Tue, 8 Oct 2019 16:21:51 +0200 Subject: [PATCH 2/4] added intensity to white and removed from grey --- src/style/winapi.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/style/winapi.rs b/src/style/winapi.rs index b3583c8..a835d41 100644 --- a/src/style/winapi.rs +++ b/src/style/winapi.rs @@ -111,8 +111,8 @@ impl From for u16 { Color::DarkMagenta => FG_RED | FG_BLUE, Color::Cyan => FG_INTENSITY | FG_GREEN | FG_BLUE, Color::DarkCyan => FG_GREEN | FG_BLUE, - Color::White => FG_RED | FG_GREEN | FG_BLUE, - Color::Grey => FG_INTENSITY | FG_RED | FG_GREEN | FG_BLUE, + Color::White => FG_INTENSITY | FG_RED | FG_GREEN | FG_BLUE, + Color::Grey => FG_RED | FG_GREEN | FG_BLUE, Color::Reset => { // safe unwrap, initial console color was set with `init_console_color`. From 7a82e36d5ad4ce6901c046cc4eacfe42b8d9b68a Mon Sep 17 00:00:00 2001 From: Timon Post Date: Tue, 8 Oct 2019 16:58:32 +0200 Subject: [PATCH 3/4] addes ansi color back --- src/lib.rs | 3 +-- src/style/winapi.rs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 41ee248..3793ad3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -241,8 +241,7 @@ impl TerminalColor { pub fn new() -> TerminalColor { #[cfg(windows)] let color = if supports_ansi() { - let a= Box::from(AnsiColor::new()) as Box<(dyn Style + Sync + Send)>; - WinApiColor::new() as Box<(dyn Style + Sync + Send)> + Box::from(AnsiColor::new()) as Box<(dyn Style + Sync + Send)>; } else { WinApiColor::new() as Box<(dyn Style + Sync + Send)> }; diff --git a/src/style/winapi.rs b/src/style/winapi.rs index a835d41..bf9a828 100644 --- a/src/style/winapi.rs +++ b/src/style/winapi.rs @@ -27,7 +27,6 @@ pub(crate) struct WinApiColor; impl WinApiColor { pub fn new() -> Box { init_console_color().unwrap(); - Box::from(WinApiColor) } } From cda535ff492442e153a45d89c409d5e8ce3cfc55 Mon Sep 17 00:00:00 2001 From: Timon Post Date: Tue, 8 Oct 2019 17:01:01 +0200 Subject: [PATCH 4/4] a --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 3793ad3..757d8a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -241,7 +241,7 @@ impl TerminalColor { pub fn new() -> TerminalColor { #[cfg(windows)] let color = if supports_ansi() { - Box::from(AnsiColor::new()) as Box<(dyn Style + Sync + Send)>; + Box::from(AnsiColor::new()) as Box<(dyn Style + Sync + Send)> } else { WinApiColor::new() as Box<(dyn Style + Sync + Send)> };