We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67a6cbc commit 1d6e7d6Copy full SHA for 1d6e7d6
crates/terminal-colorsaurus/examples/theme.rs
@@ -1,18 +1,16 @@
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};
+#![allow(clippy::use_debug)]
5
+
6
+use terminal_colorsaurus::{color_palette, Error};
7
8
fn main() -> Result<(), display::DisplayAsDebug<Error>> {
9
let colors = color_palette()?;
-
- 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