One formula, twelve knobs, an entire smooth palette. Every color here comes from color(t) = a + b · cos(2π(c·t + d)) — a cosine wave per channel, three channels, each with its own offset, amplitude, frequency, and phase. Turn a knob and the whole gradient, its per-channel curves, and its swatches update live.
This is the cosine gradient technique — a small, well-known trick from procedural color work: because cos is smooth, cyclical, and bounded to [-1, 1], scaling and offsetting one per channel turns four short vectors (a, b, c, d — offset, amplitude, frequency, phase) into an entire continuous palette, with no banding and no manual color-stop editing. a sets each channel's midpoint, b its swing around that midpoint, c how many times it cycles across the gradient, and d where in that cycle it starts — stagger d across the three channels and you get hue rotation for free.
The Plasma preset isn't just a nice rainbow — it's the same palette recipe already running the plasma shader on Media Servers II: equal offset and amplitude on every channel, one full cycle each, phases spaced exactly a third of a turn apart. That page hard-codes it in GLSL as three sin() terms; this instrument just makes the same four vectors tunable instead of fixed, and lets you export the result back out as a GLSL-ready vec3 or a plain JS array.
Palette Synth is the first of five visual synths for this site, all now built — instruments where wave shape, color, or geometric form are generated live through math rather than drawn by hand. Its color engine (this exact formula) is reused, not reinvented, throughout: the Additive Wave Sculptor sums sines instead of cosines, the Lissajous / Harmonograph Plotter plots two of those sums against each other, the Audio-Reactive Reaction-Diffusion instrument drives real chemistry with sound, and the Complex-Plane Fractal Mapper colors the Mandelbrot and Julia sets with this exact formula.