xxxxxxxxxx
18
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
for (let x = 0; x < width; x += 40) {
if (mouseX > x && mouseX < x+ 40) {
fill("red");
rect(x, 0, 40, height);
} else {
fill("white");
rect(x, 0, 40, height);
}
}
}
// is the mouse greath than the x position than is it greater than 40 which is the piel of the one column