Fill Color when path is complete

I trying to figure out how to create a rule which would check if a path or the outline of a shape was complete, and if complete fill that shape with a solid color. So if the user draws a complete square, circle, or triangle the shape would fill with a solid color.
Any Ideas?
Any Ideas?