Guest User

Untitled

a guest
Dec 10th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. from gui import *
  2. from timer import *
  3. import time
  4.  
  5. b = True
  6.  
  7. def updateColor(shape):
  8. while b:
  9. for count in range(0,3):
  10. #From red (255,0,0) to blue (0,0,255)
  11. for i in range(0,255):
  12. red = 255 - i
  13. green = 0
  14. blue = i
  15. color = Color(red,green,blue)
  16. shape.setColor(color)
  17. time.sleep(0.01)
  18. if color == Color(1,0,254):
  19. #From blue (0,0,255) to red (255,0,0)
  20.  
  21. for i in range(0,255):
  22. red = i
  23. green = 0
  24. blue = 255 - i
  25. color = Color(red,green,blue)
  26. shape.setColor(color)
  27. time.sleep(0.01)
Add Comment
Please, Sign In to add comment