diff --git a/internal/color.go b/internal/color.go index 3c7ac2f..e8f0c4e 100644 --- a/internal/color.go +++ b/internal/color.go @@ -42,6 +42,8 @@ func (hsv HSV) RGBA () (r, g, b, a uint32) { h := clamp01(hsv.H) * 360 sector := int(h / 60) + // otherwise when given 1.0 for H, sector would overflow to 6 + if sector > 5 { sector = 5 } offset := (h / 60) - float64(sector) p := component(v * (1 - s))