# Recipe 49: Draw the picture in Figure 5.16

def coolpic():

  canvas=makeEmptyPicture(250, 250) #make an empty picture
  pos = 1 #starting position for first rectangle to be drawn
  for index in range(25,1,-1): #loop in reverse from 25 to 1
    color = makeColor(index*10,index*5,index) #make a color based on loop position
    addRectFilled(canvas,pos,pos,index*10,index*10,color) #create a filed rectangle in the picture with dimensions based on loop position
    pos = pos + 5 #increment the position for rectangle to drawn at
    
  show(canvas)
  return canvas
