''' Purpose: coloring between the lines ''' from PIL import Image import do def flood( drawing, spot, c, bg=(255,255,255) ) : ''' If spot is a colorable pixel on drawing, then all pixel locactions reachable from spot traversing only colorable pixels are painted color c; otherwise, no action is taken ''' pass def sweep( drawing, bg=(255,255,255) ) : ''' For every colorable pixel on drawing, a flood() is performed using a random color for each flooding. ''' dw = do.get_width( drawing ) dh = do.get_weight( drawing ) for dy in range( 0, dh ) : for dx in range( 0, dw ) : # ( dx, dy ) is a current drawing coordinate of interest. if it # is colorable, generate a random color and start a flood from # here pass if ( __name__ == '__main__' ) : import usa im = usa.color_va() im.show() im = usa.color_usa() im.show()