Skip to content

Commit 69dd1d9

Browse files
committed
chore: Match rustc's colors
1 parent 4678730 commit 69dd1d9

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/renderer/mod.rs

+18-5
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,28 @@ impl Renderer {
6262

6363
/// Default terminal styling
6464
pub const fn styled() -> Self {
65+
const BRIGHT_BLUE: Style = if cfg!(windows) {
66+
AnsiColor::BrightCyan.on_default().effects(Effects::BOLD)
67+
} else {
68+
AnsiColor::BrightBlue.on_default().effects(Effects::BOLD)
69+
};
6570
Self {
6671
stylesheet: Stylesheet {
6772
error: AnsiColor::BrightRed.on_default().effects(Effects::BOLD),
68-
warning: AnsiColor::BrightYellow.on_default().effects(Effects::BOLD),
69-
info: AnsiColor::BrightBlue.on_default().effects(Effects::BOLD),
70-
note: Style::new().effects(Effects::BOLD),
73+
warning: if cfg!(windows) {
74+
AnsiColor::BrightYellow.on_default().effects(Effects::BOLD)
75+
} else {
76+
AnsiColor::Yellow.on_default().effects(Effects::BOLD)
77+
},
78+
info: BRIGHT_BLUE,
79+
note: AnsiColor::BrightGreen.on_default().effects(Effects::BOLD),
7180
help: AnsiColor::BrightCyan.on_default().effects(Effects::BOLD),
72-
line_no: AnsiColor::BrightBlue.on_default().effects(Effects::BOLD),
73-
emphasis: Style::new().effects(Effects::BOLD),
81+
line_no: BRIGHT_BLUE,
82+
emphasis: if cfg!(windows) {
83+
AnsiColor::BrightWhite.on_default().effects(Effects::BOLD)
84+
} else {
85+
Style::new().effects(Effects::BOLD)
86+
},
7487
none: Style::new(),
7588
},
7689
..Self::plain()

0 commit comments

Comments
 (0)