["c41e3d", "7d1128", "ff2c55", "3c0919", "e2294f"],
colorPalettes.forEach((palette) => {
palette.forEach((color, index) => {
if (palette[index].startsWith("#")) return;
palette[index] = "#" + color.toString();
const backgroundColors = [
sxnoise = new OpenSimplexNoise(Date.now());
colorPalette = colorPalettes[floor(random(colorPalettes.length))];
radiusMax = radiusMin * 2;
lineWidthMax = lineWidthMin * 2;
colorPalettes.indexOf(colorPalette),
const chosenBackgroundColor =
backgroundColors[floor(random(backgroundColors.length))];
background(chosenBackgroundColor);
for (let y = gridSize; y < height; y += gridSize) {
for (let x = gridSize; x < width; x += gridSize) {
const noiseValue = sxnoise.noise2D(x * noiseScale, y * noiseScale);
const rSize = map(noiseValue, -1, 1, radiusMin, radiusMax);
const colorIndex = floor(map(noiseValue, -1, 1, 0, colorPalette.length));
const chosenColor = colorPalette[colorIndex];
const lineWidth = map(noiseValue, -1, 1, lineWidthMin, lineWidthMax);
const angle = map(noiseValue, -1, 1, 0, TWO_PI);
const newX = x + cos(angle) * r;
const newY = y + sin(angle) * r;
fill(chosenBackgroundColor);
quad(0, 0, width, 0, width, 25, 0, 25);
quad(0, 0, 0, height, 25, height, 25, 0);
quad(0, height, width, height, width, height - 25, 25, height - 25);
quad(width - 25, 0, width, 0, width, height, width - 25, height);
function granulate(amount) {
const d = pixelDensity();
const pixelsCount = 4 * (width * d) * (height * d);
for (let i = 0; i < pixelsCount; i += 4) {
const grainAmount = random(-amount, amount);
pixels[i] = pixels[i] + grainAmount;
pixels[i + 1] = pixels[i + 1] + grainAmount;
pixels[i + 2] = pixels[i + 2] + grainAmount;