A rough linear_to_srgb that takes the square root of each channel, the inverse of srgb_to_linear_pow2. A negative channel gives NaN.
#import "Math";
assert(linear_to_srgb_sqrt(xyz(0.25, 1, 0)) == xyz(0.5, 1, 0));linear_to_srgb_sqrt :: (c: Vector3) -> Vector3
Parameters
- c: Vector3
Returns
linear_to_srgb_sqrt :: (c: Vector4) -> Vector4
Takes the square root of the red, green and blue channels and leaves alpha as it is.
Parameters
- c: Vector4
Returns
#import "Math";
assert(linear_to_srgb_sqrt(xyzw(0.25, 1, 0, 0.3)) == xyzw(0.5, 1, 0, 0.3));