diff options
Diffstat (limited to 'internal/colors')
-rw-r--r-- | internal/colors/hsl.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/colors/hsl.go b/internal/colors/hsl.go index 51a1785..5a6a66c 100644 --- a/internal/colors/hsl.go +++ b/internal/colors/hsl.go @@ -92,6 +92,10 @@ func (h HSL) FromPrecise(p PreciseColor) ColorSpace { hue = (r-g)/delta + 4 } hue /= 6 + hue = math.Mod(hue, 1) + if hue < 0 { + hue += 1 + } } return HSL{ |