# `tinycolor`


A tiny but mighty Rust utility crate for printing colored strings in the terminal
## Why `tinycolor`?
`tinycolor` is designed for Rust terminal/CLI programs where binary size and compile times matter
It does one thing and does it well: adding ANSI colors to your terminal output
## Comparisons
| `crossterm` | 7500+ |
| `colored` | 2000+ |
| `termcolor` | 1800+ |
| `tinycolor` | Only **881!** ✨ |
`tinycolor` fits in just under 900 lines and the entire crate can stay in one single [`lib.rs`](src/lib.rs)!
## See `tinycolor` in action
Add this in your `Cargo.toml`:
```toml
[dependencies]
tinycolor = "1"
```
or run:
```bash
cargo add tinycolor
```
And add this in your `lib.rs` or `main.rs`:
```rust
use tinycolor::Colorize;
fn main() {
println!("{}{} {}{}",
"Hello".green().bold(),
",".on_cyan().italic(),
"world".rgb(207, 177, 150).dim(),
"!".on_red().blink()
);
}
```
## Features
- **Zero dependencies by default** - keeps your build lean
- **Simple API** - just import and use
- **Serde support** - enable with `features = ["serde"]`
- **Extended colors** - enable with `features = ["color-ext"]` for additional effects
## Why you might want alternatives
- Need cursor movement or terminal events? Use [`crossterm`](https://crates.io/crates/crossterm)
- Need logging integration? Use [`colored`](https://crates.io/crates/colored) or [`termcolor`](https://crates.io/crates/termcolor)
- Need to support Windows 7? Test with `tinycolor` first (ANSI support varies)
But if you just want to print pretty colors with minimal overhead, `tinycolor` is for you!