# File: ChapterGraphics/colorsRand0.py """ Random colored circle in the middle of the canva myc = color_rgb(r,g,b) # mix your own color myc = color_rgb(random.randrange(255),random.randrange(255),random.randrange(255)) """ from graphics import * import random def colorRand(): r = random.randint(0, 255) # RED Integer 0 - 255 g = random.randint(0, 255) # GREEN Integer 0 - 255 b = random.randint(0, 255) # BLUE Integer 0 - 255 return color_rgb(r,g,b) # mix your own color def main(): win = GraphWin( "Random colored circles") #default 200x200 c = Circle(Point(100,100) , 45 ) # make a circle radius 45 mycolor = colorRand() c.setFill( mycolor ) c.setOutline( color_rgb(random.randint(100,250),100,30)) c.draw( win ) # draw the circle main()