Rollup merge of #118756 - jyn514:colors, r=estebank
use bold magenta instead of bold white for highlighting according to a poll of gay people in my phone, purple is the most popular color to use for highlighting | color | percentage | | ---------- | ---------- | | bold white | 6% | | blue | 14% | | cyan | 26% | | purple | 37% | | magenta | 17% | unfortunately, purple is not supported by 16-color terminals, which rustc apparently wants to support for some reason. until we require support for full 256-color terms (e.g. by doing the same feature detection as we currently do for urls), we can't use it. instead, i have collapsed the purple votes into magenta on the theory that they're close, and also because magenta is pretty. before:  after:  other colors for comparison: blue:  cyan:  purple:  magenta without bolding:  r? ``@estebank``
This commit is contained in:
commit
dfc5ffacd3
8 changed files with 144 additions and 23 deletions
|
@ -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) => {
|
||||
|
@ -2719,7 +2719,7 @@ impl Style {
|
|||
spec.set_bold(true);
|
||||
}
|
||||
Style::Highlight => {
|
||||
spec.set_bold(true);
|
||||
spec.set_bold(true).set_fg(Some(Color::Magenta));
|
||||
}
|
||||
}
|
||||
spec
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue