Advertisement
here2share

# rgb_cycle.py

Aug 19th, 2024 (edited)
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. # rgb_cycle.py
  2.  
  3. def rgb_cycle(value):
  4.     if value % 2:
  5.         return max(0, value-2)
  6.     else:
  7.         return min(255, value+2)
  8.        
  9. v = 0
  10. while 1:
  11.     print(v)
  12.     v = rgb_cycle(v)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement