""" ChapterAnimation/mouseChangeBackground.py change color of the background when you click mouse """ import random from graphics import * def main(): win = GraphWin( "Change Color when click", 300,300) while True: if win.getMouse(): # click mouse r = random.randint(0,255) g = random.randint(0,255) b = random.randint(0,255) win.setBackground(color_rgb(r,g,b)) #win.close() main()