#color #xterm #x11 #color-string

xterm-color

Parses the subset of X11 Color Strings emitted by terminals in response to OSC color queries

2 stable releases

1.0.1 Jan 6, 2025
1.0.0 Jan 3, 2025

#199 in Command-line interface

Download history 230/week @ 2025-01-01 29/week @ 2025-01-08

259 downloads per month

MIT/Apache

16KB
268 lines

xterm-color

Docs Crate Version

Parses the subset of X11 Color Strings emitted by terminals in response to OSC color queries (OSC 10, OSC 11, ...).

Example

use xterm_color::Color;
let color = Color::parse(b"rgb:11/aa/ff").unwrap();
assert_eq!(color, Color::rgb(0x1111, 0xaaaa, 0xffff));

Docs

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.

No runtime deps