@@ -61,16 +61,20 @@ impl Renderer {
61
61
}
62
62
63
63
/// Default terminal styling
64
+ ///
65
+ /// # Note
66
+ /// When testing styled terminal output, see the [`testing-colors` feature](crate#features)
64
67
pub const fn styled ( ) -> Self {
65
- const BRIGHT_BLUE : Style = if cfg ! ( windows) {
68
+ const USE_WINDOWS_COLORS : bool = cfg ! ( windows) && !cfg ! ( feature = "testing-colors" ) ;
69
+ const BRIGHT_BLUE : Style = if USE_WINDOWS_COLORS {
66
70
AnsiColor :: BrightCyan . on_default ( )
67
71
} else {
68
72
AnsiColor :: BrightBlue . on_default ( )
69
73
} ;
70
74
Self {
71
75
stylesheet : Stylesheet {
72
76
error : AnsiColor :: BrightRed . on_default ( ) . effects ( Effects :: BOLD ) ,
73
- warning : if cfg ! ( windows ) {
77
+ warning : if USE_WINDOWS_COLORS {
74
78
AnsiColor :: BrightYellow . on_default ( )
75
79
} else {
76
80
AnsiColor :: Yellow . on_default ( )
@@ -80,7 +84,7 @@ impl Renderer {
80
84
note : AnsiColor :: BrightGreen . on_default ( ) . effects ( Effects :: BOLD ) ,
81
85
help : AnsiColor :: BrightCyan . on_default ( ) . effects ( Effects :: BOLD ) ,
82
86
line_no : BRIGHT_BLUE . effects ( Effects :: BOLD ) ,
83
- emphasis : if cfg ! ( windows ) {
87
+ emphasis : if USE_WINDOWS_COLORS {
84
88
AnsiColor :: BrightWhite . on_default ( )
85
89
} else {
86
90
Style :: new ( )
0 commit comments