/
colors.go
57 lines (50 loc) · 1.24 KB
/
colors.go
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
package main
const enableColors = true // TODO: make this optional
const (
colorReset = "\033[0m"
colorMissing = "\033[31m"
colorSame = "\033[32m"
colorDifferent = "\033[34m"
colorPartiallySame = "\033[36m"
colorCommon = "\033[37m"
)
// colorForMissing returns the given string colored as missing
func colorForMissing(str string) string {
if enableColors {
return colorMissing + str + colorReset
} else {
return str
}
}
// colorForSame returns the given string colored as same
func colorForSame(str string) string {
if enableColors {
return colorSame + str + colorReset
} else {
return str
}
}
// colorForDifferent returns the given string colored as different
func colorForDifferent(str string) string {
if enableColors {
return colorDifferent + str + colorReset
} else {
return str
}
}
// colorForPartiallySame returns the given string colored as partially the same
func colorForPartiallySame(str string) string {
if enableColors {
return colorPartiallySame + str + colorReset
} else {
return str
}
}
// colorForCommon returns the given string colored as common
func colorForCommon(str string) string {
if enableColors {
return colorCommon + str + colorReset
} else {
return str
}
}