xxxxxxxxxx
24
let rWidth = 2;
function setup() {
createCanvas(400, 400);
background(220, 20, 120);
noStroke();
}
function draw() {}
function drawNoise() {
for (let y = 0; y < height; y += rWidth) {
for (let x = 0; x < width; x += rWidth) {
let c = 255 * noise(x / 100, y / 100);
fill(c);
rect(x, y, rWidth, rWidth);
}
}
}
function mouseClicked() {
drawNoise();
}