@@ -154,9 +154,9 @@ func interp_angle(a0, a1, t float64) float64 {
154
154
/// HSV ///
155
155
///////////
156
156
// From http://en.wikipedia.org/wiki/HSL_and_HSV
157
- // Note that h is in [0..360 ] and s,v in [0..1]
157
+ // Note that h is in [0..359 ] and s,v in [0..1]
158
158
159
- // Hsv returns the Hue [0..360 ], Saturation and Value [0..1] of the color.
159
+ // Hsv returns the Hue [0..359 ], Saturation and Value [0..1] of the color.
160
160
func (col Color ) Hsv () (h , s , v float64 ) {
161
161
min := math .Min (math .Min (col .R , col .G ), col .B )
162
162
v = math .Max (math .Max (col .R , col .G ), col .B )
@@ -186,7 +186,7 @@ func (col Color) Hsv() (h, s, v float64) {
186
186
return
187
187
}
188
188
189
- // Hsv creates a new Color given a Hue in [0..360 ], a Saturation and a Value in [0..1]
189
+ // Hsv creates a new Color given a Hue in [0..359 ], a Saturation and a Value in [0..1]
190
190
func Hsv (H , S , V float64 ) Color {
191
191
Hp := H / 60.0
192
192
C := V * S
@@ -238,7 +238,7 @@ func (c1 Color) BlendHsv(c2 Color, t float64) Color {
238
238
/// HSL ///
239
239
///////////
240
240
241
- // Hsl returns the Hue [0..360 ], Saturation [0..1], and Luminance (lightness) [0..1] of the color.
241
+ // Hsl returns the Hue [0..359 ], Saturation [0..1], and Luminance (lightness) [0..1] of the color.
242
242
func (col Color ) Hsl () (h , s , l float64 ) {
243
243
min := math .Min (math .Min (col .R , col .G ), col .B )
244
244
max := math .Max (math .Max (col .R , col .G ), col .B )
@@ -273,7 +273,7 @@ func (col Color) Hsl() (h, s, l float64) {
273
273
return
274
274
}
275
275
276
- // Hsl creates a new Color given a Hue in [0..360 ], a Saturation [0..1], and a Luminance (lightness) in [0..1]
276
+ // Hsl creates a new Color given a Hue in [0..359 ], a Saturation [0..1], and a Luminance (lightness) in [0..1]
277
277
func Hsl (h , s , l float64 ) Color {
278
278
if s == 0 {
279
279
return Color {l , l , l }
@@ -1130,4 +1130,3 @@ func (col1 Color) BlendOkLch(col2 Color, t float64) Color {
1130
1130
// We know that h are both in [0..360]
1131
1131
return OkLch (l1 + t * (l2 - l1 ), c1 + t * (c2 - c1 ), interp_angle (h1 , h2 , t )).Clamped ()
1132
1132
}
1133
-
0 commit comments