This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec3 hsv2rgb(vec3 c) { | |
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); | |
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); | |
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); | |
} | |
const vec4 K = vec4(1., 2. / 3., 1. / 3., 3.); | |
vec3 hsv2rgb(vec3 c) | |
{ | |
// from http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl |