1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
fn colourise(text: &str, colour: i8) -> String {
return "\x1b[".to_owned() + &colour.to_string() + "m" + text + "\x1b[0m";
}
pub fn colour(text: &str, colour: &str) -> String {
match colour {
"black" | "b" => return colourise(text, 30),
"red" | "r" => return colourise(text, 31),
"green" | "g" => return colourise(text, 32),
"yellow" | "y" => return colourise(text, 33),
"blue" | "bl" => return colourise(text, 34),
"magenta" | "m" => return colourise(text, 35),
"cyan" | "c" => return colourise(text, 36),
"white"| "w" => return colourise(text, 37),
"brightblack" | "bb" => return colourise(text, 90),
"brightred" | "br" => return colourise(text, 91),
"brightgreen" | "bg" => return colourise(text, 92),
"brightyellow" | "by" => return colourise(text, 93),
"brightblue" | "bbl"=> return colourise(text, 94),
"brightmagenta" | "bm" => return colourise(text, 95),
"brightcyan" | "bc" => return colourise(text, 96),
"brightwhite" | "bw" => return colourise(text, 97),
"backgroundred" | "b-r" => return colourise(text, 41),
"backgroundgreen" | "b-g" => return colourise(text, 42),
"backgroundyellow" | "b-y" => return colourise(text, 43),
"backgroundblue" | "b-b" => return colourise(text, 44),
"backgroundmagenta" | "b-m" => return colourise(text, 45),
"backgroundcyan" | "b-c" => return colourise(text, 46),
"bacgroundwhite" | "b-w" => return colourise(text, 47),
"backgroundbrightblack" | "b-bb" => return colourise(text, 100),
"backgroundbrightred" | "b-br" => return colourise(text, 101),
"backgroundbrightgreen" | "b-bg" => return colourise(text, 102),
"backgroundbrightyellow" | "b-by" => return colourise(text, 103),
"backgroundbrightblue" | "b-bbl" => return colourise(text, 104),
"backgroundbrightmagenta" | "b-bm" => return colourise(text, 105),
"backgroundbrightcyan" | "b-bc" => return colourise(text, 106),
"backgroundbrightwhite" | "b-bw" => return colourise(text, 107),
_ => return colourise("no colour selected!", 93)
}
}