terminal-colorsaurus

Crates.ioterminal-colorsaurus
lib.rsterminal-colorsaurus
version0.4.2
sourcesrc
created_at2024-01-20 19:40:53.285611
updated_at2024-05-30 12:19:46.164833
descriptionDetermines the background and foreground color of the terminal
homepage
repositoryhttps://github.com/bash/terminal-colorsaurus
max_upload_size
id1106783
size114,812
Tau Gärtli (bash)

documentation

README

terminal-colorsaurus 🦕

Docs Crate Version

Determines the background and foreground color of the terminal using the OSC 10 and OSC 11 escape codes.

This library helps answer the question «Is this terminal dark or light?».

Windows is unfortunately not supported.

Example

use terminal_colorsaurus::{color_scheme, QueryOptions, ColorScheme};

match color_scheme(QueryOptions::default()).unwrap() {
    ColorScheme::Dark => { /* ... */ },
    ColorScheme::Light => { /* ... */ },
}

Docs

Inspiration

This crate borrows ideas from many other projects. This list is by no means exhaustive.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 200

cargo fmt