LYGIA Shader Library

hueShift (lygia/color/hueShift)

shifts color hue

Dependencies:

Use:

hueShift(<vec3|vec4> color, <float> amount)

Check it on Github



#ifndef FNC_HUESHIFT
#define FNC_HUESHIFT
vec3 hueShift(in vec3 v, in float a) {
    vec3 hsv = rgb2hsv(v);
    hsv.r += a;
    return hsv2rgb(hsv);
}

vec4 hueShift(in vec4 v, in float a) {
    return vec4(hueShift(v.rgb, a), v.a);
}
#endif

Dependencies:

Use:

hueShift(<float3|float4> color, <float> amount)

Check it on Github



#ifndef FNC_HUESHIFT
#define FNC_HUESHIFT
float3 hueShift(in float3 color, in float amount) {
    float3 hsv = rgb2hsv(color);
    hsv.r += amount;
    return hsv2rgb(hsv);
}

float4 hueShift(in float4 color, in float amount) {
    return float4(hueShift(color.rgb, amount), color.a);
}
#endif

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