
Vari
Vari (Väri) is a Rust library for formatting strings with colors and cosmetic stuff to the terminal. Like Rich library for Python.
Installing
[]
= "0.1.6"
Features
Color Anchor
Color anchor are a bbcode-like markup for colors and styles (eg. "[$red]", "[bg$yellow]", "[$bold]")
// [$/] is shorthand for [$reset]
let message = format;
println!;
// Custom RGB!
println!;
// Style anchor and also easy macros :O
vprintln!;
// Background color
vprintln!
Colorize
Colorize string directly by calling colorize() method, like colored crate.
For example: "red".colorize("red") is the same as "[$red]red[$/]"
Note: Chaining is not yet implemented, because .colorize() adds [$/] so you can't chain styles
The argument should be the color's name (the same name as the anchor colors).
use Colorize;
Fun
License
This crate is under AGPL-3.0 license.