I want to update each pixel to red, so this is my code
const canvasWidth = 800
const canvasHeight = 600
function setup() {
createCanvas(canvasWidth, canvasHeight)
loadPixels()
let xoff = 0
for (let x = 0; x < canvasWidth; x++) {
let yoff = 0
for (let y = 0; y < canvasHeight; y++) {
pixels[x + y * canvasWidth] = color('red')
yoff += + 0.01;
}
xoff += 0.01
}
updatePixels()
}
But the code seems doesn't work