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 (
5959 Auto = "auto"
6060)
6161
62+ // ansiColorOffset is the offset for basic foreground colors in ANSI escape codes.
63+ const ansiColorOffset = 30
64+
6265// SetANSIMode configure formatter for colored output on ANSI-compliant console
6366func SetANSIMode (streams command.Streams , ansi string ) {
6467 if ! useAnsi (streams , ansi ) {
@@ -127,8 +130,8 @@ func rainbowColor() colorFunc {
127130func init () {
128131 colors := map [string ]colorFunc {}
129132 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" )
132135 }
133136 rainbow = []colorFunc {
134137 colors ["cyan" ],
You can’t perform that action at this time.
0 commit comments