LYGIA Shader Library

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

oklab to linear RGB https://bottosson.github.io/posts/oklab/

Dependencies:

Use:

<vec3\vec4> oklab2rgb(<vec3|vec4> oklab)

Check it on Github



#ifndef FNC_OKLAB2RGB
#define FNC_OKLAB2RGB
vec3 oklab2rgb(const in vec3 oklab) { return srgb2rgb(oklab2srgb(oklab)); }
vec4 oklab2rgb(const in vec4 oklab) { return vec4(oklab2rgb(oklab.xyz), oklab.a); }
#endif

Dependencies:

Use:

<float3\float4> oklab2rgb(<float3|float4> oklab)

Check it on Github



#ifndef FNC_OKLAB2RGB
#define FNC_OKLAB2RGB
float3 oklab2rgb(const in float3 oklab) { return srgb2rgb(oklab2srgb(oklab)); }
float4 oklab2rgb(const in float4 oklab) { return float4(oklab2rgb(oklab.xyz), oklab.a); }
#endif

Dependencies:

Use:

<vec3\vec4> oklab2rgb(<vec3|vec4> oklab)

Check it on Github



fn oklab2rgb(oklab: vec3f) -> vec3f { return srgb2rgb(oklab2srgb(oklab)); }

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