LYGIA Shader Library

zorn (lygia/color/palette/zorn)

Zorn palette where: - 0: Titanium White - 1: Yellow Ocher - 2: Cadmium Red - 3: Ivory Black

Dependencies:

Check it on Github



#ifndef ZORN_TOTAL
#define ZORN_TOTAL 4
#endif

#ifndef FNC_ZORN
#define FNC_ZORN
vec3 zorn(int index) {
    vec3 colors[4];
    colors[0] = TITANIUM_WHITE;
    colors[1] = YELLOW_OCHRE;
    colors[2] = CADMIUM_RED;
    colors[3] = IVORY_BLACK;

    index = int(mod(float(index), float(ZORN_TOTAL)));
    #if defined(PLATFORM_WEBGL)
    for (int i = 0; i < ZORN_TOTAL; i++)
        if (i == index) return colors[i];
    #else
    return colors[index];
    #endif
}
#endif

Examples

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