sRGB
伝達特性
$ V = \left\{ \begin{array}{ll} 12.92L & L < 0.0031308 \\ 1.055 L^{\frac{1.0}{2.4}} - 0.055 & L \geq 0.0031308 \end{array} \right.
code:glsl
vec3 linearToSRGB(vec3 l) {
return mix(
12.92 * l,
1.055 * pow(l, vec3(1.0 / 2.4)) - 0.055,
step(0.0031308, l)
);
}
https://gyazo.com/6083a4fb9fca5502c9164ad7bcf1d9ca
$ L = \left\{ \begin{array}{ll} \frac{V}{12.92} & V < 0.04045 \\ \left( \frac{V + 0.055}{1.055} \right)^{2.4} & V \geq 0.04045 \end{array} \right.
code:glsl
vec3 sRGBToLinear(vec3 v) {
return mix(
v / 12.92,
pow((v + 0.055) / 1.055, vec3(2.4)),
step(0.04045, v)
);
}
https://gyazo.com/e4d0750c5c9928747485e054a67002a5
table:色域
X Y
R 0.640 0.330
G 0.300 0.600
B 0.150 0.060
Gの色域が甘め