Brijesh's Git Server — bsh @ 476de6711bde624186baf0ab1b748a04341e0644

my own shell program

src/colours.rs (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
pub fn red(text: &str) -> String {
    format!("\x1b[31m{}\x1b[0m", text)
}

pub fn green(text: &str) -> String {
    format!("\x1b[32m{}\x1b[0m", text)
}

pub fn yellow(text: &str) -> String {
    format!("\x1b[33m{}\x1b[0m", text)
}

pub fn blue(text: &str) -> String {
    format!("\x1b[34m{}\x1b[0m", text)
}

pub fn magenta(text: &str) -> String {
    format!("\x1b[35m{}\x1b[0m", text)
}

pub fn cyan(text: &str) -> String {
    format!("\x1b[36m{}\x1b[0m", text)
}