''' graphics0.py Jeff Ondich, 11 October 2018 Developed originally in Pascal by Jeff Ondich on 1/25/95 Ported to C++, Java, and Python Adapted to Python 3 by Jed Yang, 2016 This program opens a graphics window, fills it with a black background, and draws a red circle in the center. Try doing these things: 0. Run the program as it is. You'll need a copy of John Zelle's graphics.py in your working directory. 1. Read the whole program to find out how it works. 2. What happens if you remove the "input()" at the end of the main program? 3. Modify the code to draw a tall and skinny graphics window. Where does the circle get drawn when you run your new version of the program? Why? 4. Change the background color. Can you make it white? 5. Make the circle green. ''' from graphics import * def main(): # Define some colors. To do color graphics, you specify colors via red, green, # and blue values. A red value of 0 means no red at all, while a red value of # 255 means as much red as possible. For example, color_rgb(255, 0, 255) is a # bright purple, while color_rgb(150, 0, 150) is a darker purple. If you want # help finding the color you're interested in, try searching the internet for # "color chart rgb". Or try https://www.w3schools.com/colors/colors_picker.asp background_color = color_rgb(0, 0, 0) circle_color = color_rgb(200, 80, 80) # Open a window with the specified title, width, and height. window_height = 400 window_width = 600 window_title = 'It\'s a Circle!' window = GraphWin(window_title, window_width, window_height) window.setBackground(background_color) # Create and draw a circle. Put it in the center of the window, and give it # a diameter that's half the size of the shortest side of the window. radius = min(window_width, window_height) / 4 center = Point(window_width / 2, window_height / 2) circle = Circle(center, radius) circle.setFill(circle_color) circle.draw(window) # Wait for user input. input('Hit Enter to quit') # Which window needs input focus for this to work? Why? main()