Srgb module

linear_to_srgb_sqrt

procedure2 overloadsSource

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.

Example↗
#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

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

Returns

Example↗
#import "Math";
assert(linear_to_srgb_sqrt(xyzw(0.25, 1, 0, 0.3)) == xyzw(0.5, 1, 0, 0.3));

See also