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