''' Provide underlying support for digital coloring book coloring ''' from PIL import Image import random def random_color() : ''' Returns a random RGB three-tuple, where each tuple element is a random value from the inclusive interval 0 ... 255. ''' pass def get_width( drawing ) : ''' Returns the width of the Image represented by drawing ''' pass def get_height( drawing ) : ''' Returns the height of the Image represented by drawing ''' pass def left( spot ) : ''' Returns the coordinate immediately left of spot; that is, its x-coordinate is one less than that of spot and its y-coordinate is the same as that of spot ''' pass def right( spot ) : ''' Returns the coordinate immediately right of spot; that is, its x-coordinate is one greater than that of spot and its y-coordinate is the same as that of spot ''' def above( spot ) : ''' Returns the coordinate immediately above spot; that is, its x-coordinate is the same as that of spot and its y-coordinate is one less than that of spot ''' pass def below( spot ) : ''' Returns the coordinate immediately below spot; that is, its x-coordinate is the same as that of spot and its y-coordinate is one greater than that of spot ''' pass def is_inbounds( drawing, spot ) : ''' Returns True or False whether coordinate spot is inbounds on the drawing image ''' pass def get_color( drawing, spot ) : ''' If coordinate spot is inbounds on the drawing image, returns the color at coordinate spot in the drawing; otherwise, the function returns None. ''' pass def is_colorable( drawing, spot, bg=(255,255,255) ) : ''' Returns True or False whether coordinate spot is a colorable pixel in the drawing image. To be colorable spot must be inbounds and equal to the background color bg ''' pass def paint( drawing, spot, c, bg=(255,255,255) ) : ''' If spot is a colorable pixel on the drawing image, the pixel at the spot is set to c; otherwise, no action is taken ''' pass