Cross-platform terminal color and style output with automatic capability detection
cargo add philiprehberger-clicolorCross-platform terminal color and style output with automatic capability detection
[dependencies]
philiprehberger-clicolor = "0.2.0"
use philiprehberger_clicolor::Colorize;
println!("{}", "Error: something failed".red().bold());
println!("{}", "Warning: check this".yellow());
println!("{}", "Success!".green().on_black());
| Function / Type | Description |
|---|---|
Colorize trait | Adds .red(), .bold(), etc. to &str |
Style | Reusable style builder |
Color | Color enum (16 colors + 256 + RGB) |
gradient(text, from, to) | Apply an RGB color gradient across characters |
force_gradient(text, from, to) | Same as gradient, ignoring color detection |
strip_ansi(s) | Remove ANSI escape codes from a string |
cargo test
cargo clippy -- -D warnings
If you find this project useful: