-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyles.go
More file actions
223 lines (178 loc) Β· 6.1 KB
/
styles.go
File metadata and controls
223 lines (178 loc) Β· 6.1 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
package color
import "fmt"
// Black returns the given text in black color.
func Black(text string) string {
return Style(text, AttrFgBlack)
}
// Blackf formats the given string using fmt.Sprintf and returns it in black color.
func Blackf(format string, a ...interface{}) string {
return Black(fmt.Sprintf(format, a...))
}
// BrightBlack returns the given text in bright black color.
func BrightBlack(text string) string {
return Style(text, AttrFgBrightBlack)
}
// BgBlack returns the given text with black background.
func BgBlack(text string) string {
return Style(text, AttrBgBlack)
}
// BgBrightBlack returns the given text with bright black background.
func BgBrightBlack(text string) string {
return Style(text, AttrBgBrightBlack)
}
// Red returns the given text in red color.
func Red(text string) string {
return Style(text, AttrFgRed)
}
// Redf formats the given string using fmt.Sprintf and returns it in red color.
func Redf(format string, a ...interface{}) string {
return Red(fmt.Sprintf(format, a...))
}
// BrightRed returns the given text in bright red color.
func BrightRed(text string) string {
return Style(text, AttrFgBrightRed)
}
// BgRed returns the given text with red background.
func BgRed(text string) string {
return Style(text, AttrBgRed)
}
// BgBrightRed returns the given text with bright red background.
func BgBrightRed(text string) string {
return Style(text, AttrBgBrightRed)
}
// Green returns the given text in green color.
func Green(text string) string {
return Style(text, AttrFgGreen)
}
// Greenf formats the given string using fmt.Sprintf and returns it in green color.
func Greenf(format string, a ...interface{}) string {
return Green(fmt.Sprintf(format, a...))
}
// BrightGreen returns the given text in bright green color.
func BrightGreen(text string) string {
return Style(text, AttrFgBrightGreen)
}
// BgGreen returns the given text with green background.
func BgGreen(text string) string {
return Style(text, AttrBgGreen)
}
// BgBrightGreen returns the given text with bright green background.
func BgBrightGreen(text string) string {
return Style(text, AttrBgBrightGreen)
}
// Yellow returns the given text in yellow color.
func Yellow(text string) string {
return Style(text, AttrFgYellow)
}
// Yellowf formats the given string using fmt.Sprintf and returns it in yellow color.
func Yellowf(format string, a ...interface{}) string {
return Yellow(fmt.Sprintf(format, a...))
}
// BrightYellow returns the given text in bright yellow color.
func BrightYellow(text string) string {
return Style(text, AttrFgBrightYellow)
}
// BgYellow returns the given text with yellow background.
func BgYellow(text string) string {
return Style(text, AttrBgYellow)
}
// BgBrightYellow returns the given text with bright yellow background.
func BgBrightYellow(text string) string {
return Style(text, AttrBgBrightYellow)
}
// Blue returns the given text in blue color.
func Blue(text string) string {
return Style(text, AttrFgBlue)
}
// Bluef formats the given string using fmt.Sprintf and returns it in blue color.
func Bluef(format string, a ...interface{}) string {
return Blue(fmt.Sprintf(format, a...))
}
// BrightBlue returns the given text in bright blue color.
func BrightBlue(text string) string {
return Style(text, AttrFgBrightBlue)
}
// BgBlue returns the given text with blue background.
func BgBlue(text string) string {
return Style(text, AttrBgBlue)
}
// BgBrightBlue returns the given text with bright blue background.
func BgBrightBlue(text string) string {
return Style(text, AttrBgBrightBlue)
}
// Magenta returns the given text in magenta color.
func Magenta(text string) string {
return Style(text, AttrFgMagenta)
}
// Magentaf formats the given string using fmt.Sprintf and returns it in magenta color.
func Magentaf(format string, a ...interface{}) string {
return Magenta(fmt.Sprintf(format, a...))
}
// BrightMagenta returns the given text in bright magenta color.
func BrightMagenta(text string) string {
return Style(text, AttrFgBrightMagenta)
}
// BgMagenta returns the given text with magenta background.
func BgMagenta(text string) string {
return Style(text, AttrBgMagenta)
}
// BgBrightMagenta returns the given text with bright magenta background.
func BgBrightMagenta(text string) string {
return Style(text, AttrBgBrightMagenta)
}
// Cyan returns the given text in cyan color.
func Cyan(text string) string {
return Style(text, AttrFgCyan)
}
// Cyanf formats the given string using fmt.Sprintf and returns it in cyan color.
func Cyanf(format string, a ...interface{}) string {
return Cyan(fmt.Sprintf(format, a...))
}
// BrightCyan returns the given text in bright cyan color.
func BrightCyan(text string) string {
return Style(text, AttrFgBrightCyan)
}
// BgCyan returns the given text with cyan background.
func BgCyan(text string) string {
return Style(text, AttrBgCyan)
}
// BgBrightCyan returns the given text with bright cyan background.
func BgBrightCyan(text string) string {
return Style(text, AttrBgBrightCyan)
}
// White returns the given text in white color.
func White(text string) string {
return Style(text, AttrFgWhite)
}
// Whitef formats the given string using fmt.Sprintf and returns it in white color.
func Whitef(format string, a ...interface{}) string {
return White(fmt.Sprintf(format, a...))
}
// BrightWhite returns the given text in bright white color.
func BrightWhite(text string) string {
return Style(text, AttrFgBrightWhite)
}
// BgWhite returns the given text with white background.
func BgWhite(text string) string {
return Style(text, AttrBgWhite)
}
// BgBrightWhite returns the given text with bright white background.
func BgBrightWhite(text string) string {
return Style(text, AttrBgBrightWhite)
}
// Bold returns the given text in bold style.
func Bold(text string) string {
return Style(text, AttrBold)
}
// Italic returns the given text in italic style.
func Italic(text string) string {
return Style(text, AttrItalic)
}
// Underline returns the given text underlined.
func Underline(text string) string {
return Style(text, AttrUnderline)
}
// Dim returns the given text in dimmed style.
func Dim(text string) string {
return Style(text, AttrDim)
}