Skip to content

Colour and palettes

Presets control colour through a shared palette. A palette is a gradient baked once at load into a lookup table that the five shader-coloured scenes sample:

  • fragment_field
  • swarm
  • reaction_diffusion
  • attractor
  • shape_field — the one whose sample coordinate is a distance rather than a level, which is what makes banding it draw offset contours

All four line scenes sample the same LUT too, but on the CPU, once per segment rather than per pixel or per particle:

So every scene reaches [palette], and a note anywhere saying a [palette] table is inert on a line scene is stale.

The backdrop reaches it too (ADR-0086): the background pre-pass samples the same baked LUT, so bg_hue is a coordinate in the preset’s own gradient — see The backdrop. There is no longer any surface in the engine that colours outside [palette], and a note saying bg_hue walks a fixed cosine whatever the preset declares is stale.

A preset that declares no [palette] gets the default spectrum palette — the exact iq cosine the scenes used before this system existed — so every shipped preset renders unchanged. (The one exception: reaction_diffusion previously used a slightly different cosine and was unified onto spectrum, so the coral presets’ colours shifted; they are being re-authored to exploit palettes.)

This is the authoring counterpart to ADR-0021 and Plan 0020. It documents colour only — the systems, expression grammar, and file layout live in the main preset guide (docs/presets.md).


Sections

Built from a8ce055 at version 0.115.0. This site tracks main and is not versioned per release.