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