Coloring book? Floodfill?

I am seeing a problem with changing colors on some objects. The color stops changing after two or three times. I noticed it's happening, not always, when the source file has a shape on top of another shape. Does this transfer over to the png in layers? Would this cause the issue?

I don't know exactly what you mean. If you are just coloring one bitmap, I think it only colors one bitmap. A shape on top can certainly block the mouse - try a noMouse() on it.

Oh... I think we solved this one somewhere but the answer does not seem to be right here. As you fill, it fills in pixels at the inner edge of the boundary color. If you fill a couple times, it eats away at the boundary and if the boundary ever erodes completely, then the next fill with a different color will not work - although why would it not then fill right through the new opening.

Anyway, there may be two solutions. 1. make a thicker boundary. 2. use an additional background transparent PNG with only the border. Then each fill cache updateCache("source-over") on the original. It should redraw the boundary.