unit 2 1.3

function setup() {
  createCanvas(600, 120);
}

function draw() {
  background(220);
rectMode(CENTER)
  
  if((mouseX>270) && (mouseX<330) && (mouseY>30) && (mouseY<90)){
    fill1 = 'red'
  }
 else if((mouseX>470) && (mouseX<530) && (mouseY>30) && (mouseY<90)){
    fill2 = 'green'
  }
  else{
    fill1 = 'white'
    fill2 = 'white'
  }
  
  fill(fill1)
  rect(300,60,60,60)
  fill(fill2)
  rect( 500,60,60,60)
}

https://preview.p5js.org/nicepelican061/present/WyNtxzZnF