4 releases

0.1.3 Mar 22, 2024
0.1.2 Feb 29, 2024
0.1.1 Aug 8, 2023
0.1.0 Jul 25, 2021

#217 in Command-line interface

Download history 157/week @ 2024-02-26 7/week @ 2024-03-04 3/week @ 2024-03-11 127/week @ 2024-03-18 65/week @ 2024-04-01

196 downloads per month

MIT license

8KB
195 lines

ttycolor

Easy way to use termcolor.

usage

cargo.toml

[dependencies]
ttycolor = "0.1.0"    # easy way to use termcolor

main.rs

extern crate ttycolor;
use ttycolor::ColorTrait;

fn main() {
    let str = "Warning";

    println!("{}: xxxxxx", str.red());
    println!("{}: xxxxxx", str.fg(ttycolor::rgb(0, 255, 0)));
    println!("{}: xxxxxx", str.cyan().bold());
    println!("{}: xxxxxx", str.white().bg_magenta().bold().italic().underline());
    
    println!("{}: xxxxxx", String::from(str).red());
    println!("{}: {}", str.green(), format!("{:018p}", str).red());
}

preview

screenshot

Dependencies

~72–250KB