All examples · Shaders and post

A console palette

What this example shows

paletteMatch() replaces every colour with the nearest one a palette actually holds. That is what makes a frame look like one particular machine rather than merely old: a NES had fifty-four specific colours, and no amount of cutting channels into even steps lands on them.

A palette is a file (.palette, a list of colours in JSON) loaded like a texture with useLoadPalette. Until it lands, the effect gives the frame back untouched: a palette that has not arrived costs you the palette, never the picture.

The palette is a field of the effect, so changing console is one assignment. Click to go from NES to Game Boy, ↑ ↓ for the dither (it shakes each pixel before the search, so a slow gradient splits between two colours instead of breaking) and Space to switch it off.

Starting