Skip to content

Commit

Permalink
Merge pull request #724 from Skytrias/master
Browse files Browse the repository at this point in the history
fix hsl math.mod to usual hsl conversion
  • Loading branch information
ThisDevDane authored Aug 29, 2020
2 parents 0216ade + 12895de commit 32fda79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/math/linalg/specific.odin
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ vector4_linear_to_srgb :: proc(col: Vector4) -> Vector4 {

vector4_hsl_to_rgb :: proc(h, s, l: Float, a: Float = 1) -> Vector4 {
hue_to_rgb :: proc(p, q, t0: Float) -> Float {
t := math.mod(t0, 1.0);
t := t;
if t < 0 do t += 1;
if t > 1 do t -= 1;
switch {
case t < 1.0/6.0: return p + (q - p) * 6.0 * t;
case t < 1.0/2.0: return q;
Expand Down

0 comments on commit 32fda79

Please sign in to comment.