# File: ChapterGraphics/rectFill1.py # Draw (Fill) a rectangle area w * h that starts at (x, y) using rgb with lines from graphics import * startx,starty = 100, 100 # up left corner width,height = 220, 75 red,blue,green = 200,70,20 def main(): win = GraphWin( "Fill rectangle pixel by pixel", 500, 500 ) mycolor = color_rgb(red,blue,green) for j in range(height): p1=Point(startx,starty+j) p2=Point(startx+width,starty+j) myline=Line(p1,p2) myline.setFill(mycolor) myline.draw(win) message = Text( Point(150,430), "Click anywhere to stop!" ) message.draw( win ) win.getMouse() win.close() main()