["#1a0120", "#553d36", "#684a52", "#857885", "#87a0b2", "#a4bef3", "#ffffff"],
["#335c67","#fff3b0","#e09f3e","#9e2a2b","#540b0e"],
["#355070","#6d597a","#b56576","#e56b6f","#eaac8b"],
["#007f5f","#2b9348","#55a630","#80b918","#aacc00","#bfd200","#d4d700","#dddf00","#eeef20","#ffff3f", "#ffffaf", "#ffffff"]
const numPoints = floor(random(random(1, 3), random(3, 9)));
const squareSize = floor(random(3, 18));
const numBands = floor(random(1, 3));
const colors = random(colorPalettes);
createCanvas(windowWidth, windowHeight);
for (let i = 0; i < numPoints; i++) {
x: random() < 0.5 ? random(width * 0.3, 0) : random(width, width * 1.3),
y: random() < 0.5 ? random(height * 0.3, 0) : random(height, height * 1.3),
period: random(0.008/3, 0.1/3)*numPoints
for(let i = 0; i < numBands; i++){
let start = random(-1, 1);
let end = start + random(0.05, 0.25);
for (let x = 0; x < width; x += squareSize) {
for (let y = 0; y < height; y += squareSize) {
for (let point of points) {
value += sin(dist(x, y, point.x, point.y) * point.period) *
map(noise(x * 0.01, y * 0.01, point.x * 0.03, point.y * 0.03), 0.2, 0.8, -0.2, 1);
value = -(abs(value)**p);
fill(colors[wrapModulo(floor(map(value, -1, 1, 0, colors.length)), colors.length)]);
for(let band of shuffle(bands)){
if ( value > band.start && value < band.end){
if(!band.chess || x/squareSize % 2 === y/squareSize % 2) {
square(x, y, squareSize);
else if (key == " ") setup();
function wrapModulo(a, b){