File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
crates/terminal-colorsaurus/examples Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 11//! This example shows how to detect if the terminal uses
22//! a dark-on-light or a light-on-dark theme.
33
4- use terminal_colorsaurus:: { color_palette, ColorScheme , Error } ;
4+ #![ allow( clippy:: use_debug) ]
5+
6+ use terminal_colorsaurus:: { color_palette, Error } ;
57
68fn main ( ) -> Result < ( ) , display:: DisplayAsDebug < Error > > {
79 let colors = color_palette ( ) ?;
8-
9- let theme = match colors. color_scheme ( ) {
10- ColorScheme :: Dark => "dark" ,
11- ColorScheme :: Light => "light" ,
12- } ;
10+ let theme = colors. color_scheme ( ) ;
1311
1412 println ! (
15- "{theme}, fg: {}, bg: {}" ,
13+ "{theme:? }, fg: {}, bg: {}" ,
1614 colors. foreground. perceived_lightness( ) ,
1715 colors. background. perceived_lightness( )
1816 ) ;
You can’t perform that action at this time.
0 commit comments