void setup() {
  size(500, 500);
  noStroke();
}
void draw() {
  background(204);
  if ((mouseX <= width/2) && (mouseY <= height/2)) {
    fill(0);
    rect(0, 0, width/2, height/2);
  } else if ((mouseX > width/2) && (mouseY < height/2)) {
    fill(50);
    rect(width/2, 0, width/2, height/2);
  } else if ((mouseX > width/2) && (mouseY > height/2)) {
    fill(100);
    rect(width/2, height/2, width/2, height/2);
  } else {
    fill(150);
    rect(0, height/2, width/2, height/2);
  }
}