Crates.io | terminal-colorsaurus |
lib.rs | terminal-colorsaurus |
version | 0.3.4 |
source | src |
created_at | 2024-01-20 19:40:53.285611 |
updated_at | 2024-06-10 11:13:23.174002 |
description | Determines the background and foreground color of the terminal |
homepage | |
repository | https://github.com/bash/terminal-colorsaurus |
max_upload_size | |
id | 1106783 |
size | 95,196 |
Determines the background and foreground color of the terminal
using the OSC 10
and OSC 11
terminal sequence.
This is useful for answering the question "Is this terminal dark or light?".
Windows is unfortunately not supported.
use terminal_colorsaurus::{color_scheme, QueryOptions};
let colors = color_scheme(QueryOptions::default()).unwrap();
dbg!(colors.is_dark_on_light());
These are some features that I would like to include in this crate, but have not yet had the time to implement. PRs are welcome :)
This crate borrows ideas from many other projects. This list is by no means exhaustive.
mio
to wait for the terminal's response with a timeout.Licensed under either of
at your option.
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.