terminal-colorsaurus

Crates.ioterminal-colorsaurus
lib.rsterminal-colorsaurus
version
sourcesrc
created_at2024-01-20 19:40:53.285611
updated_at2025-01-24 12:24:41.815146
descriptionA cross-platform library for determining the terminal's background and foreground color. It answers the question «Is this terminal dark or light?».
homepage
repositoryhttps://github.com/bash/terminal-colorsaurus
max_upload_size
id1106783
Cargo.toml error:TOML parse error at line 26, column 1 | 26 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Tau Gärtli (bash)

documentation

README

terminal-colorsaurus 🦕

Docs Crate Version

A cross-platform library for determining the terminal's background and foreground color.
It answers the question «Is this terminal dark or light?».

Works in all major terminals including Windows Terminal (starting with v1.22).

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: 299

cargo fmt