LYGIA Shader Library

rgb2lch (lygia/color/space/rgb2lch)

Converts a RGB color to LCh color space.

Dependencies:

Use:

<vec3|vec4> rgb2lch(<vec3|vec4> color)

Check it on Github



#ifndef FNC_RGB2LCH
#define FNC_RGB2LCH
vec3 rgb2lch(const in vec3 rgb) { return lab2lch(rgb2lab(rgb)); }
vec4 rgb2lch(const in vec4 rgb) { return vec4(rgb2lch(rgb.rgb),rgb.a); }
#endif

Dependencies:

Use:

<float3|float4> rgb2lch(<float3|float4> color)

Check it on Github



#ifndef FNC_RGB2LCH
#define FNC_RGB2LCH
float3 rgb2lch(const in float3 rgb) { return lab2lch(rgb2lab(rgb)); }
float4 rgb2lch(const in float4 rgb) { return float4(rgb2lch(rgb.rgb),rgb.a); }
#endif

Dependencies:

Use:

<float3|float4> rgb2lch(<float3|float4> color)

Check it on Github



#ifndef FNC_RGB2LCH
#define FNC_RGB2LCH
float3 rgb2lch( float3 rgb) { return lab2lch(rgb2lab(rgb)); }
float4 rgb2lch( float4 rgb) { return float4(rgb2lch(rgb.rgb),rgb.a); }
#endif

Dependencies:

Check it on Github




fn rgb2lch(rgb: vec3f ) -> vec3f { return lab2lch(rgb2lab(rgb)); }

Licenses

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