summaryrefslogtreecommitdiff
path: root/internal/colors/hsl.go
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-11-24 04:01:37 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-11-24 04:01:37 -0500
commit8b4d17786425b63ec45f6df189eab1ea7dcbf6a7 (patch)
tree9a3142e0047dd283f4ba739ef473a0346c7599ad /internal/colors/hsl.go
parent84221bddb581ecdb78ba36e2cf5e61665f2be5f9 (diff)
Freaking hsl doesn't reset to cyan everytime
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{