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