@@ -61,16 +61,25 @@ impl Renderer {
6161 }
6262
6363 /// Default terminal styling
64+ ///
65+ /// # Note
66+ /// Some colors are OS dependant, meaning that the colors will look
67+ /// different on different operating systems, making testing colored output
68+ /// difficult.
69+ /// If you are testing the colored output, you can use the
70+ /// [`testing-colors` feature](crate#features) to enable colors that are OS
71+ /// independent.
6472 pub const fn styled ( ) -> Self {
65- const BRIGHT_BLUE : Style = if cfg ! ( windows) {
73+ const USE_WINDOWS_COLORS : bool = cfg ! ( windows) && !cfg ! ( feature = "testing-colors" ) ;
74+ const BRIGHT_BLUE : Style = if USE_WINDOWS_COLORS {
6675 AnsiColor :: BrightCyan . on_default ( )
6776 } else {
6877 AnsiColor :: BrightBlue . on_default ( )
6978 } ;
7079 Self {
7180 stylesheet : Stylesheet {
7281 error : AnsiColor :: BrightRed . on_default ( ) . effects ( Effects :: BOLD ) ,
73- warning : if cfg ! ( windows ) {
82+ warning : if USE_WINDOWS_COLORS {
7483 AnsiColor :: BrightYellow . on_default ( )
7584 } else {
7685 AnsiColor :: Yellow . on_default ( )
@@ -80,7 +89,7 @@ impl Renderer {
8089 note : AnsiColor :: BrightGreen . on_default ( ) . effects ( Effects :: BOLD ) ,
8190 help : AnsiColor :: BrightCyan . on_default ( ) . effects ( Effects :: BOLD ) ,
8291 line_no : BRIGHT_BLUE . effects ( Effects :: BOLD ) ,
83- emphasis : if cfg ! ( windows ) {
92+ emphasis : if USE_WINDOWS_COLORS {
8493 AnsiColor :: BrightWhite . on_default ( )
8594 } else {
8695 Style :: new ( )
0 commit comments