We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2997a2c commit 5cadac6Copy full SHA for 5cadac6
crates/terminal-colorsaurus/examples/theme.rs
@@ -1,18 +1,14 @@
1
//! This example shows how to detect if the terminal uses
2
//! a dark-on-light or a light-on-dark theme.
3
4
-use terminal_colorsaurus::{color_palette, ColorScheme, Error};
+use terminal_colorsaurus::{color_palette, Error};
5
6
fn main() -> Result<(), display::DisplayAsDebug<Error>> {
7
let colors = color_palette()?;
8
-
9
- let theme = match colors.color_scheme() {
10
- ColorScheme::Dark => "dark",
11
- ColorScheme::Light => "light",
12
- };
+ let theme = colors.color_scheme();
13
14
println!(
15
- "{theme}, fg: {}, bg: {}",
+ "{theme:?}, fg: {}, bg: {}",
16
colors.foreground.perceived_lightness(),
17
colors.background.perceived_lightness()
18
);
0 commit comments