xxxxxxxxxx
20
function setup() {
createCanvas(400, 400);
pixelDensity(1);
}
function draw() {
background(50);
loadPixels();
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
let index = (x + y * width) * 4;
pixels[index + 0] = x;
pixels[index + 1] = random(60);
pixels[index + 2] = y;
pixels[index + 3] = 100;
}
}
updatePixels();
}