let canvas_width = 500; let canvas_height = 500; let cell_size = 5; let start = 0; // let f = (x, y) => // ((12212 * x * y + 8912 * x + 481 * y) % 271) < 135; function f(x, y) { return ((12212 * x * y + 8912 * x + 481 * y) % 271); } function setup() { createCanvas(canvas_width, canvas_height); } function draw() { colorMode(HSL, 255, 100, 100); background(0); fill(0); noStroke(); // square(0, 0, canvas_width / 20); for (let x = 0; x < canvas_width; x += 1) { for (let y = 0; y < canvas_height; y += 1) { // if (f(x, y)) set(x, y, color(255)); // else set(x, y, color(0)); let val = f(x + start, y + start); let col = color(val, 100, 50); set(x, y, col); } } updatePixels(); start += 1; }