blob: 7dde37c7903aad25549065030980e4642589867c [file] [log] [blame]
half4 main(half4 hsl) {
// HSL-to-RGB conversion algorithm lifted from sksl_shared $hsl_to_rgb.
half C = (1 - abs(2 * hsl.z - 1)) * hsl.y;
half3 p = hsl.xxx + half3(0, 2/3.0, 1/3.0);
half3 q = saturate(abs(fract(p) * 6 - 3) - 1);
return half4((q - 0.5) * C + hsl.z, 1);
}