xxxxxxxxxx
34
let grid = [];
let DIM = 800;
function setup() {
createCanvas(DIM, DIM);
pixelDensity(1);
noiseDetail(4, 0.75);
background(0);
for (let y = 0; y < height; y++) {
grid[y] = [];
for (let x = 0; x < width; x++) {
let n = noise(x * 0.01, y * 0.01);
let c = 0;
if (n < 0.2) c = 20;
else if (n > 0.25 && n < 0.4) c = 80;
else if (n > 0.45 && n < 0.6) c = 120;
else if (n > 0.65 && n < 0.8) c = 180;
else if (n > 0.85 && n < 0.95) c = 22;
grid[y][x] = {n:n, c:c};
noStroke();
fill(c);
circle(x,y,4);
}
}
}
function draw() {
// background(220);
}