File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ const (
59
59
Auto = "auto"
60
60
)
61
61
62
+ // ansiColorOffset is the offset for basic foreground colors in ANSI escape codes.
63
+ const ansiColorOffset = 30
64
+
62
65
// SetANSIMode configure formatter for colored output on ANSI-compliant console
63
66
func SetANSIMode (streams command.Streams , ansi string ) {
64
67
if ! useAnsi (streams , ansi ) {
@@ -127,8 +130,8 @@ func rainbowColor() colorFunc {
127
130
func init () {
128
131
colors := map [string ]colorFunc {}
129
132
for i , name := range names {
130
- colors [name ] = makeColorFunc (strconv .Itoa (30 + i ))
131
- colors ["intense_" + name ] = makeColorFunc (strconv .Itoa (30 + i ) + ";1" )
133
+ colors [name ] = makeColorFunc (strconv .Itoa (ansiColorOffset + i ))
134
+ colors ["intense_" + name ] = makeColorFunc (strconv .Itoa (ansiColorOffset + i ) + ";1" )
132
135
}
133
136
rainbow = []colorFunc {
134
137
colors ["cyan" ],
You can’t perform that action at this time.
0 commit comments