# TintColor
[](https://crates.io/crates/tintify)


A zero-allocation no_std-compatible zero-cost way to add color to your Rust terminal.
**Supports:**
- [x] All std/core formatters
- [x] [Display](https://doc.rust-lang.org/std/fmt/trait.Display.html)
- [x] [Debug](https://doc.rust-lang.org/std/fmt/trait.Debug.html)
- [x] [Octal](https://doc.rust-lang.org/std/fmt/trait.Octal.html)
- [x] [LowerHex](https://doc.rust-lang.org/std/fmt/trait.LowerHex.html)
- [x] [UpperHex](https://doc.rust-lang.org/std/fmt/trait.UpperHex.html)
- [x] [Pointer](https://doc.rust-lang.org/std/fmt/trait.Pointer.html)
- [x] [Binary](https://doc.rust-lang.org/std/fmt/trait.Binary.html)
- [x] [LowerExp](https://doc.rust-lang.org/std/fmt/trait.LowerExp.html)
- [x] [UpperExp](https://doc.rust-lang.org/std/fmt/trait.UpperExp.html)
- [x] Optional checking for if a terminal supports colors
- [x] Enabled for CI
- [x] Disabled by default for non-terminal outputs
- [x] Overridable by `NO_COLOR`/`FORCE_COLOR` environment variables
- [x] Overridable programmatically via `set_override`
- [x] Dependency-less by default
- [x] 100% safe code
- [x] Most functions are `const`
- [x] Hand-picked names for all ANSI (4-bit) and Xterm (8-bit) colors
- [x] Support for RGB colors
- [x] Set colors at compile time by generics or at runtime by value
- [x] All ANSI colors
- [x] Basic support (normal and bright variants)
- [x] Xterm support (high compatibility and 256 colors)
- [x] Truecolor support (modern, 48-bit color)
- [x] Styling (underline, strikethrough, etc)
tintify is also more-or-less a drop-in replacement for
[colored](https://crates.io/crates/colored), allowing colored to work in a
no_std environment. No allocations or dependencies required because embedded
systems deserve to be pretty too uwu.
To add to your Cargo.toml:
```toml
tintify = "1.0.0"
```
## Example
```rust
use tintify::TintColorize;
fn main() -> () {
// Foreground colors
println!("My number is {:#x}!", 10.green());
// Background colors
println!("My number is not {}!", 4.on_red());
}
```
## Generic colors
```rust
use tintify::TintColorize;
use tintify::colors::*;
fn main() -> () {
// Generically color
println!("My number might be {}!", 4.fg::<Black>().bg::<Yellow>());
}
```
## Stylize
```rust
use tintify::TintColorize;
println!("{}", "strikethrough".strikethrough());
```
## Only Style on Supported Terminals
```rust
use tintify::TintColorize;
use tintify::Stream::Stdout;
Supports `NO_COLOR`/`FORCE_COLOR` environment variables, checks if it's a tty,
checks if it's running in CI (and thus likely supports color), and checks which
terminal is being used. (Note: requires `supports-colors` feature)