summaryrefslogtreecommitdiff
path: root/internal/colors/hsl.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/colors/hsl.go')
-rw-r--r--internal/colors/hsl.go4
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{