xxxxxxxxxx
21
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255);
let w = width / 20;
for (let i = 0; i < width; i += 20) {
if (mouseX > i && mouseX < i + w) {
if ((i / w) % 2 ===0){
fill('blue')
} else {
fill('red');
}
}
rect(i, 0, w, height);
fill('white');
}
}