arnaucube
arnaucube/galdricPublic Self-hosted repository
galdric/color.go
color.goRaw
 1package main
 2
 3import "fmt"
 4
 5//Color struct, defines the color
 6type Color struct{}
 7
 8var c Color
 9
10//DarkGray color
11func (c Color) DarkGray(t string) {
12	fmt.Print("\x1b[30;1m") //dark gray
13	fmt.Println(t)
14	fmt.Print("\x1b[0m") //defaultColor
15}
16
17//Red color
18func (c Color) Red(t string) {
19	fmt.Print("\x1b[31;1m") //red
20	fmt.Println(t)
21	fmt.Print("\x1b[0m") //defaultColor
22}
23
24//Green color
25func (c Color) Green(t string) {
26	fmt.Print("\x1b[32;1m") //green
27	fmt.Println(t)
28	fmt.Print("\x1b[0m") //defaultColor
29}
30
31//Yellow color
32func (c Color) Yellow(t string) {
33	fmt.Print("\x1b[33;1m") //yellow
34	fmt.Println(t)
35	fmt.Print("\x1b[0m") //defaultColor
36}
37
38//Blue color
39func (c Color) Blue(t string) {
40	fmt.Print("\x1b[34;1m") //blue
41	fmt.Println(t)
42	fmt.Print("\x1b[0m") //defaultColor
43}
44
45//Purple color
46func (c Color) Purple(t string) {
47	fmt.Print("\x1b[35;1m") //purple
48	fmt.Println(t)
49	fmt.Print("\x1b[0m") //defaultColor
50}
51
52//Cyan color
53func (c Color) Cyan(t string) {
54	fmt.Print("\x1b[36;1m") //cyan
55	fmt.Println(t)
56	fmt.Print("\x1b[0m") //defaultColor
57}