Example 12 — color output
Wave Color Field
Two wave samplers with shift: true drive hue and brightness across a 2D field. Every 4 seconds the formulas morph into new ones over 2 seconds — the colour landscape keeps evolving.
Core snippet
var hueSampler = Waves.createSampler({
wave: 'meta sine', shift: true,
shiftInterval: 4, shiftDuration: 2,
range: [160, 320], seed: 0
});
var briSampler = Waves.createSampler({
wave: 'wobble sine', shift: true,
shiftInterval: 5, shiftDuration: 2,
range: [55, 90], seed: 7
});
// In draw:
for (var y = 0; y < height; y += 4) {
for (var x = 0; x < width; x += 4) {
fill(hueSampler.sample(x*0.007 + y*0.005, t),
72,
briSampler.sample(x*0.005 - y*0.007, t*0.6));
rect(x, y, 4, 4);
}
}