Skip to content

Commit 627f6b9

Browse files
justenwalkermuesli
authored andcommitted
fix: add missing color to ansi256ToANSIColor
Previously, converting #ffffff to Ansi would return 7 (#c0c0c0) instead of 15 (#ffffff). This is because not all of the ANSIColor ids from 0-15 were checked due to a missing `=` in the loop.
1 parent 3facc67 commit 627f6b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

color.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func ansi256ToANSIColor(c ANSI256Color) ANSIColor {
169169
md := math.MaxFloat64
170170

171171
h, _ := colorful.Hex(ansiHex[c])
172-
for i := 0; i < 15; i++ {
172+
for i := 0; i <= 15; i++ {
173173
hb, _ := colorful.Hex(ansiHex[i])
174174
d := h.DistanceLab(hb)
175175

0 commit comments

Comments
 (0)