xxxxxxxxxx
18
function setup() {
createCanvas(600, 600);
}
function draw() {
background(20);
noStroke();
if (mouseX < width / 3 && mouseX > 0) {
fill(255, 0, 50);
rect(0, 0, width / 3, height);
} else if (mouseX < 2 * width / 3) {
fill(255, 0, 50);
rect(width / 3, 0, width / 3, height);
} else if (mouseX > 2 * width / 3 && mouseX < width) {
fill(255, 0, 50);
rect(2 * width / 3, 0, width / 3, height);
}
}