Change colors on different objects blinking

You can use PGraphics and createGraphics() to draw your flowers on top of the blinking lights.

Above setup, declare:

PGraphics flowers;

in setup(), initialize:

flowers = createGraphics(800, 800); // note that 800, 800 is same size as your window in setup so you can draw anywhere inside your sketch window and the flowers will show up

In if (mousePressed == true)
draw (mouse click your flower shapes.

The structure looks like this:

if (mousePressed == true) {
 flowers.beginDraw();
 flowers.fill(0);
 flowers.ellipse(mouseX, mouseY, 50, 50);
 flowers.endDraw(); 
  }
 image(flowers, 0, 0);
}

You can read more about createGraphics() here:

Basically with PGraphics you are creating another layer that sits above your sketch. I have heard others describe it as a sketch within a sketch.

:nerd_face:

2 Likes