-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolors.go
146 lines (134 loc) · 1.88 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
package color
type Hue uint
const (
Indigo Hue = iota
Blue
LightBlue
Cyan
Teal
Green
LightGreen
Lime
Yellow
Amber
Orange
Brown
BlueGrey
Grey
DeepOrange
Red
Pink
Purple
DeepPurple
)
func (h Hue) String() string {
switch h {
case Indigo:
return "indigo"
case Blue:
return "blue"
case LightBlue:
return "light-blue"
case Cyan:
return "cyan"
case Teal:
return "teal"
case Green:
return "green"
case LightGreen:
return "light-green"
case Lime:
return "lime"
case Yellow:
return "yellow"
case Amber:
return "amber"
case Orange:
return "orange"
case Brown:
return "brown"
case BlueGrey:
return "blue-grey"
case Grey:
return "grey"
case DeepOrange:
return "deep-orange"
case Red:
return "red"
case Pink:
return "pink"
case Purple:
return "purple"
case DeepPurple:
return "deep-purple"
}
return ""
}
type Shade uint
const (
S50 Shade = iota
S100
S200
S300
S400
S500
S600
S700
S800
S900
A100
A200
A400
A700
)
func (s Shade) String() string {
switch s {
case S50:
return "50"
case S100:
return "100"
case S200:
return "200"
case S300:
return "300"
case S400:
return "400"
case S500:
return "500"
case S600:
return "600"
case S700:
return "700"
case S800:
return "800"
case S900:
return "900"
case A100:
return "A100"
case A200:
return "A200"
case A400:
return "A400"
case A700:
return "A700"
}
return ""
}
type Color string
func Class(h Hue, s Shade) Color {
return Color(h.String() + "-" + s.String())
}
const (
Black Color = "black"
Primary Color = "primary"
PrimaryDark Color = "primary-dark"
PrimaryContrast Color = "primary-contrast"
Accent Color = "accent"
AccentContrast Color = "accent-contrast"
)
func (c Color) Background() string {
return "mdl-color--" + string(c)
}
func (c Color) Text() string {
return "mdl-color-text--" + string(c)
}