yansi-term 0.1.2

Library for ANSI terminal colours and styles (bold, underline)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate yansi_term;
use yansi_term::{Colour::*, Style};

// This example prints out the 16 basic colours.

fn main() {
    println!(
        "{}",
        Red.paint_fn(|f| {
            f.write_str("RED")?;
            Style::new().bold().write_prefix(f)?;
            f.write_str("RED_BOLD")?;
            Style::write_reset(f)?;
            Black.write_prefix(f)?;
            f.write_str("BLACK")
        })
    );
}