Skip to content

Commit

Permalink
fix: add missing color to ansi256ToANSIColor
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
justenwalker authored and muesli committed Jul 19, 2020
1 parent 3facc67 commit 627f6b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion color.go
Expand Up @@ -169,7 +169,7 @@ func ansi256ToANSIColor(c ANSI256Color) ANSIColor {
md := math.MaxFloat64

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

Expand Down

0 comments on commit 627f6b9

Please sign in to comment.