Brijesh's Git Server — bsh @ 4a881edf07a45d2a03f1f47ef5be6886acc8c883

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)
}