-
Notifications
You must be signed in to change notification settings - Fork 0
/
colorFunctions.go
216 lines (173 loc) · 4.65 KB
/
colorFunctions.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
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
package ansi
import "github.com/sam-caldwell/exit"
/*
* Ansi Colors - Functions
*
* This file contains the functions which can be used as
* the root of a command-chain (see colorMethods.go) or
* as stand-alone functions.
*
* (c) 2023 Sam Caldwell. MIT License
*/
// BgBlack - set color and return a new color object
func BgBlack() *Color {
return (&Color{}).BgBlack()
}
// BgBlue - set color and return a new color object
func BgBlue() *Color {
return (&Color{}).BgBlue()
}
// BgCyan - set color and return a new color object
func BgCyan() *Color {
return (&Color{}).BgCyan()
}
// BgGreen - set color and return a new color object
func BgGreen() *Color {
return (&Color{}).BgGreen()
}
// BgMagenta - set color and return a new color object
func BgMagenta() *Color {
return (&Color{}).BgMagenta()
}
// BgRed - set color and return a new color object
func BgRed() *Color {
return (&Color{}).BgRed()
}
// BgWhite - set color and return a new color object
func BgWhite() *Color { return (&Color{}).BgWhite() }
// BgYellow - set color and return a new color object
func BgYellow() *Color {
return (&Color{}).BgYellow()
}
// Black - set color and return a new color object
func Black() *Color {
return (&Color{}).Black()
}
// Blink - set format attribute and return a new color object
func Blink() *Color {
return (&Color{}).Blink()
}
// Blue - set color and return a new color object
func Blue() *Color {
return (&Color{}).Blue()
}
// Bold - set format attribute and return a new color object
func Bold() *Color {
return (&Color{}).Bold()
}
// Clear - set format attribute and return a new color object
func Clear() *Color {
return (&Color{}).Clear()
}
// Cyan - set color and return a new color object
func Cyan() *Color {
return (&Color{}).Cyan()
}
// Dim - decrease intensity and return a new color object
func Dim() *Color {
return (&Color{}).Dim()
}
// Down - move cursor n units and return a new color object
func Down(n int) *Color {
return (&Color{}).Down(n)
}
// Fatal - Terminate the program and return the exit code
func Fatal(exitCode exit.Code) *Color {
return (&Color{}).Fatal(exitCode)
}
// Flush - Flush StdOut buffer
func Flush() *Color {
return (&Color{}).Flush()
}
// Green - set color and return a new color object
func Green() *Color {
return (&Color{}).Green()
}
// Hidden - set format attribute and return a new color object
func Hidden() *Color {
return (&Color{}).Hidden()
}
// Indent - indent n spaces
func Indent(n int) *Color {
return (&Color{}).Indent(n)
}
// Left - move cursor n units and return a new color object
func Left(n int) *Color {
return (&Color{}).Left(n)
}
// LF - print a line feed char
func LF() *Color {
return (&Color{}).LF()
}
// Line - Print a line of 'num' 'ch' characters
func Line(ch string, num int) *Color {
return (&Color{}).Line(ch, num)
}
// Magenta - set color and return a new color object
func Magenta() *Color {
return (&Color{}).Magenta()
}
// Print - print text to stdout and return color object
func Print(message string) *Color {
return (&Color{}).Print(message)
}
// Printf - print text to stdout and return color object
func Printf(format string, a ...any) *Color {
return (&Color{}).Printf(format, a...)
}
// Println - print text to stdout and return color object
func Println(message string) *Color {
return (&Color{}).Println(message)
}
// Red - set color and return a new color object
func Red() *Color {
return (&Color{}).Red()
}
// Reverse - set format attribute and return a new color object
func Reverse() *Color {
return (&Color{}).Reverse()
}
// Reset - Send Reset to stdout and return new color object
func Reset() *Color {
return (&Color{}).Reset()
}
// Right - move cursor n units and return a new color object
func Right(n int) *Color {
return (&Color{}).Right(n)
}
// Space - print a Space character
func Space() *Color {
return (&Color{}).Space()
}
// Strikethrough - set format attribute and return a new color object
func Strikethrough() *Color {
return (&Color{}).Strikethrough()
}
// Tab - print a Tab char
func Tab() *Color {
return (&Color{}).Tab()
}
// Time - print current time
func Time() *Color {
return (&Color{}).Time()
}
// TopLeft - Move cursor to top left and return a new color object
func TopLeft() *Color {
return (&Color{}).TopLeft()
}
// Underline - set format attribute and return a new color object
func Underline() *Color {
return (&Color{}).Underline()
}
// Up - move cursor n units and return a new color object
func Up(n int) *Color {
return (&Color{}).Up(n)
}
// White - set color and return a new color object
func White() *Color {
return (&Color{}).White()
}
// Yellow - set color and return a new color object
func Yellow() *Color {
return (&Color{}).Yellow()
}