-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcolors.go
50 lines (46 loc) · 1.15 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
package main
const (
colorBlack = "black"
colorGray = "gray"
colorRed = "red"
colorBrightRed = "brightred"
colorGreen = "green"
colorBrightGreen = "brightgreen"
colorBrown = "brown"
colorYellow = "yellow"
colorBlue = "blue"
colorBrightBlue = "brightblue"
colorMagenta = "magenta"
colorBrightMagenta = "brightmagenta"
colorCyan = "cyan"
colorBrightCyan = "brightcyan"
colorLightGray = "lightgray"
colorWhite = "white"
)
type colorsType map[string]bool
func (c colorsType) exists(names ...string) string {
for _, name := range names {
if _, ok := c[name]; !ok {
return name
}
}
return ""
}
var colors = colorsType{
colorBlack: true,
colorGray: true,
colorRed: true,
colorBrightRed: true,
colorGreen: true,
colorBrightGreen: true,
colorBrown: true,
colorYellow: true,
colorBlue: true,
colorBrightBlue: true,
colorMagenta: true,
colorBrightMagenta: true,
colorCyan: true,
colorBrightCyan: true,
colorLightGray: true,
colorWhite: true,
}