Our class created a simple drawing program, and I suggested we add a paint fill capability. Why not select a color from a palette, and then if you click on an unpainted region, it fills the region with the selected color.
Here's a simple example. Translated by processing.js, the fonts and edges are aliased, which leads to missed pixels near the edges of the filled region. So I added a
removeSmoothingForProcessingJS method which I call after drawing the ellipses. It is not needed if running in Processing.