diff --git a/console/palette.go b/console/palette.go index 959db20..2907262 100644 --- a/console/palette.go +++ b/console/palette.go @@ -67,6 +67,9 @@ func GetPalette(theme Theme) Palette { } func GetGradientColor(gradient []ui.Color, cur int, max int) ui.Color { + if cur > max { + cur = max + } ratio := float64(len(gradient)) / float64(max) return gradient[int(ratio*float64(cur))] }