Press Play.
import turtle, time screen = turtle.Screen() #global red, green, blue red = 256; green = 0; blue = 0 def changeColor(addSub, rgb, var): global red, green, blue for i in range(256): if addSub == "+": rgb+=1 else: rgb-=1 if var == 'red': red = rgb elif var == 'green': green = rgb else: blue = rgb screen.bgcolor(red/256, green/256, blue/256) time.sleep(0.01) while True: changeColor("+", green, 'green') changeColor('-', red, 'red') changeColor("+", blue, 'blue') changeColor('-', green, 'green') changeColor("+", red, 'red') changeColor('-', blue, 'blue')