mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 05:51:58 +00:00
Simplify and comment the special-casing for Windows colors
This commit is contained in:
parent
d6fa38a9b2
commit
9f0c6f15ce
@ -2674,6 +2674,14 @@ fn from_stderr(color: ColorConfig) -> Destination {
|
||||
}
|
||||
}
|
||||
|
||||
/// On Windows, BRIGHT_BLUE is hard to read on black. Use cyan instead.
|
||||
///
|
||||
/// See #36178.
|
||||
#[cfg(windows)]
|
||||
const BRIGHT_BLUE: Color = Color::Cyan;
|
||||
#[cfg(not(windows))]
|
||||
const BRIGHT_BLUE: Color = Color::Blue;
|
||||
|
||||
impl Style {
|
||||
fn color_spec(&self, lvl: Level) -> ColorSpec {
|
||||
let mut spec = ColorSpec::new();
|
||||
@ -2688,11 +2696,7 @@ impl Style {
|
||||
Style::LineNumber => {
|
||||
spec.set_bold(true);
|
||||
spec.set_intense(true);
|
||||
if cfg!(windows) {
|
||||
spec.set_fg(Some(Color::Cyan));
|
||||
} else {
|
||||
spec.set_fg(Some(Color::Blue));
|
||||
}
|
||||
spec.set_fg(Some(BRIGHT_BLUE));
|
||||
}
|
||||
Style::Quotation => {}
|
||||
Style::MainHeaderMsg => {
|
||||
@ -2707,11 +2711,7 @@ impl Style {
|
||||
}
|
||||
Style::UnderlineSecondary | Style::LabelSecondary => {
|
||||
spec.set_bold(true).set_intense(true);
|
||||
if cfg!(windows) {
|
||||
spec.set_fg(Some(Color::Cyan));
|
||||
} else {
|
||||
spec.set_fg(Some(Color::Blue));
|
||||
}
|
||||
spec.set_fg(Some(BRIGHT_BLUE));
|
||||
}
|
||||
Style::HeaderMsg | Style::NoStyle => {}
|
||||
Style::Level(lvl) => {
|
||||
|
Loading…
Reference in New Issue
Block a user