This program demonstrates how to fill a closed shape with a color. Even around holes! Draw a shape and press the 'f' key while pointing inside it. It will fill the white area with the current color. I added white (for erasing) but it won't fill with the background white color. NOTE: This algorithm broke with Scratch 2.0, but you can get an idea of how it works by holding down 'f' and moving the mouse.
Flood Fill Example: It uses the "scanline with stack" flood fill algorithm, which is explained here -- http://lodev.org/cgtutor/floodfill.html Enjoy.