neco-tui
Zero-dependency minimal ANSI terminal helpers. Provides text styling via SGR escape sequences.
Usage
Styled text
use ;
// Foreground color
println!;
// Bold + color
println!;
// Dim display
println!;
Composing styles
The builder returned by style() supports method chaining. It implements Display for use with println! and format!.
use ;
let prompt = format!;
API
| Item | Description |
|---|---|
style(text) |
Returns a style builder |
Styled::fg(color) |
Set foreground color |
Styled::bold() |
Bold text |
Styled::dim() |
Dim text |
Color |
Standard 8 colors (Black, Red, Green, Yellow, Blue, Magenta, Cyan, White) |
Style::RESET |
SGR reset sequence (\x1b[0m) |
License
MIT