Skip to content

Commit 28d94bd

Browse files
committed
chore: Match rustc's colors
1 parent 4678730 commit 28d94bd

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

src/renderer/mod.rs

+20-5
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,30 @@ 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()
67+
} else {
68+
AnsiColor::BrightBlue.on_default()
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()
75+
} else {
76+
AnsiColor::Yellow.on_default()
77+
}
78+
.effects(Effects::BOLD),
79+
info: BRIGHT_BLUE.effects(Effects::BOLD),
80+
note: AnsiColor::BrightGreen.on_default().effects(Effects::BOLD),
7181
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),
82+
line_no: BRIGHT_BLUE.effects(Effects::BOLD),
83+
emphasis: if cfg!(windows) {
84+
AnsiColor::BrightWhite.on_default()
85+
} else {
86+
Style::new()
87+
}
88+
.effects(Effects::BOLD),
7489
none: Style::new(),
7590
},
7691
..Self::plain()

0 commit comments

Comments
 (0)