lygia
/color
/space
/lab2srgb
)Converts a Lab color to RGB color space. https://en.wikipedia.org/wiki/CIELAB_color_space
Dependencies:
Use:
<vec3|vec4> lab2srgb(<vec3|vec4> color)
#ifndef FNC_LAB2SRGB
#define FNC_LAB2SRGB
vec3 lab2srgb(const in vec3 lab) { return xyz2srgb( lab2xyz( lab ) ); }
vec4 lab2srgb(const in vec4 lab) { return vec4(lab2srgb(lab.rgb), lab.a); }
#endif
Dependencies:
Use:
<float3|float4> lab2srgb(<float3|float4> color)
#ifndef FNC_LAB2SRGB
#define FNC_LAB2SRGB
float3 lab2srgb(const in float3 lab) {
return xyz2srgb( lab2xyz( lab ) );
// return xyz2srgb( lab2xyz( float3( 100.0 * lab.x,
// 2.0 * 127.0 * (lab.y - 0.5),
// 2.0 * 127.0 * (lab.z - 0.5)) ) );
}
float4 lab2srgb(const in float4 lab) { return float4(lab2srgb(lab.rgb), lab.a); }
#endif
Dependencies:
Use:
<float3|float4> lab2srgb(<float3|float4> color)
#ifndef FNC_LAB2SRGB
#define FNC_LAB2SRGB
float3 lab2srgb( float3 lab) { return xyz2srgb( lab2xyz( lab ) ); }
float4 lab2srgb( float4 lab) { return float4(lab2srgb(lab.rgb), lab.a); }
#endif
Dependencies:
fn lab2srgb(lab: vec3f) -> vec3f { return xyz2srgb( lab2xyz( lab ) ); }
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.
Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository