fix(cli): colors mismatch
@@ -4,7 +4,9 @@ use regex::Regex;
use std::env;
use std::fmt;
use std::io::Write;
-use termcolor::Color::{Ansi256, Black, Blue, Green, Magenta, Red, White};
+use termcolor::Color::{
+ Ansi256, Black, Blue, Cyan, Green, Magenta, Red, White, Yellow,
+};
use termcolor::{Ansi, ColorSpec, WriteColor};
#[cfg(windows)]
@@ -55,10 +57,7 @@ pub fn red_bold(s: &str) -> impl fmt::Display {
pub fn green_bold(s: &str) -> impl fmt::Display {
let mut style_spec = ColorSpec::new();
- style_spec
- .set_fg(Some(Green))
- .set_bold(true)
- .set_intense(true);
+ style_spec.set_fg(Some(Green)).set_bold(true);
style(&s, style_spec)
}
@@ -82,19 +81,19 @@ pub fn white_on_red(s: &str) -> impl fmt::Display {
pub fn white_on_green(s: &str) -> impl fmt::Display {
let mut style_spec = ColorSpec::new();
- style_spec.set_bg(Some(Ansi256(10))).set_fg(Some(White));
+ style_spec.set_bg(Some(Green)).set_fg(Some(White));
style(&s, style_spec)
}
pub fn yellow(s: &str) -> impl fmt::Display {
let mut style_spec = ColorSpec::new();
- style_spec.set_fg(Some(Ansi256(11)));
+ style_spec.set_fg(Some(Yellow));
style(&s, style_spec)
}
pub fn cyan(s: &str) -> impl fmt::Display {
let mut style_spec = ColorSpec::new();
- style_spec.set_fg(Some(Ansi256(14)));
+ style_spec.set_fg(Some(Cyan));
style(&s, style_spec)
}
@@ -106,7 +105,7 @@ pub fn red(s: &str) -> impl fmt::Display {
pub fn green(s: &str) -> impl fmt::Display {
let mut style_spec = ColorSpec::new();
- style_spec.set_fg(Some(Green)).set_intense(true);
+ style_spec.set_fg(Some(Green));
style(&s, style_spec)
}
