#author("2024-12-25T07:44:07+00:00","default:yoya","yoya")
[[ColorSpace]] > [[HSL]] | [[ColorSpace/HLS]](別名)
- [[ColorSpace/HLS]] の別名
- http://en.wikipedia.org/wiki/HSL_and_HSV
- HSLのかいせつ。
-- http://moon.gmobb.jp/renno/cgi/junk.cgi/paintgraphic2/rikutsu/hsl.htm
- RGBとHSLの相互変換ツールと変換計算式
-- http://www.peko-step.com/tool/hslrgb.html#ppick3
- HSL to RGB color conversion
-- http://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion
- Color Channels
-- http://bersoft.com/bimagem/help/color_channels.htm ([https://web.archive.org/web/20210107112714/http://bersoft.com/bimagem/help/color_channels.htm 20210107])
* GLSL [#l706e4ab]
- OpenGL ES:Convert RGB to HSV, not HSL
-- https://stackoverflow.com/questions/68901847/opengl-esconvert-rgb-to-hsv-not-hsl
vec3 convertRgbToHsl(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 convertHslToRgb(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);
}
* 関連 [#rel]
- [[color]]
- [[CSS3/Color]]