xxxxxxxxxx
20
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255);
let w = width / 20;
for (let i = 0; i < 20; i++) {
if (mouseX > i * w && mouseX < (i + 1) * w) {
fill(random(255), random(255), random(255));
} else {
fill(255);
}
rect(i * w, 0, w, height);
}
}