X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fmath%2Fglm.hpp;h=80126aaa31908e7d309d68ac4fdbeba58da2013a;hp=46843db4ca2850603d4ca9001dab12b1cc302bae;hb=2ab70a92ae39cebc6166ef15545ebcbd31a31c38;hpb=e22daa10d55c26f15a170ab76645e656e956901c diff --git a/src/math/glm.hpp b/src/math/glm.hpp index 46843db..80126aa 100644 --- a/src/math/glm.hpp +++ b/src/math/glm.hpp @@ -55,8 +55,8 @@ template inline T hsl2rgb(const T &hsl) { using Vec3 = glm::tvec3; using Vec4 = glm::tvec4; - const Vec4 K(0.0, -1.0/3.0, 2.0/3.0, -1.0); - const Vec3 p(glm::abs(glm::fract(Vec3(hsl.h) + Vec3(K)) * 6.0 - Vec3(K.w))); + const Vec4 K(1.0, 2.0/3.0, 1.0/3.0, 3.0); + const Vec3 p(glm::abs(glm::fract(Vec3(hsl.x) + Vec3(K)) * 6.0 - Vec3(K.w))); T rgb = hsl.z * glm::mix(Vec3(K.x), glm::clamp(p - Vec3(K.x), 0.0, 1.0), hsl.y); return rgb; }