File: overwrite.rs

package info (click to toggle)
rust-yansi-term 0.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 196 kB
  • sloc: makefile: 2
file content (18 lines) | stat: -rw-r--r-- 425 bytes parent folder | download | duplicates (20)
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")
        })
    );
}