LYGIA Shader Library

rgb2oklab (lygia/v1.2.0/color/space/rgb2oklab)

Linear rgb ot OKLab https://bottosson.github.io/posts/oklab/

Dependencies:

Use:

<vec3\vec4> rgb2oklab(<vec3|vec4> srgb)

Check it on Github



#ifndef FNC_RGB2OKLAB
#define FNC_RGB2OKLAB
vec3 rgb2oklab(const in vec3 rgb) { srgb2oklab( rgb2srgb(rgb) ); }
vec4 rgb2oklab(const in vec4 rgb) { return vec4(rgb2oklab(rgb.rgb), rgb.a); }
#endif

Dependencies:

Use:

<float3\float4> rgb2oklab(<float3|float4> srgb)

Check it on Github



#ifndef FNC_RGB2OKLAB
#define FNC_RGB2OKLAB
float3 rgb2oklab(const in float3 rgb) { srgb2oklab( rgb2srgb(rgb) ); }
float4 rgb2oklab(const in float4 rgb) { return float4(rgb2oklab(rgb.rgb), rgb.a); }
#endif

Dependencies:

Use:

<vec3\vec4> rgb2oklab(<vec3|vec4> srgb)

Check it on Github



fn rgb2oklab(rgb: vec3f) -> vec3f { srgb2oklab( rgb2srgb(rgb) ); }

License

LYGIA is dual-licensed under the Prosperity License and the Patron License for sponsors and contributors.

Sponsors and contributors are automatically added to the Patron License and they can ignore the any non-commercial rule of the Prosperity Licensed software (please take a look to the exception).

It's also possible to get a permanent comercial license hook to a single and specific version of LYGIA.

Get the latest news and releases

Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository