Skip to content

Instantly share code, notes, and snippets.

@phette23
Created June 29, 2013 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save phette23/5891271 to your computer and use it in GitHub Desktop.
Save phette23/5891271 to your computer and use it in GitHub Desktop.
Never-ending rainbow effect in Boston Python Workshop's ColorWall project https://openhatch.org/wiki/Boston_Python_Workshop_7/Friday/OSX_project_dependencies
def RainbowTest(wall):
print "RainbowTest"
rainbowColors = [ colors["red"], colors["orange"], colors["yellow"], colors["green"], colors["baby blue"], colors["blue"], colors["purple"] ]
i = 0
for y in range( wall.height ):
color = rainbowColors[ i ]
i += 1
if i == 7:
i = 0
for x in range( wall.width ):
wall.set_pixel( x, y, color )
wall.draw()
time.sleep( 0.2 )
wall.clear()
RainbowTest( wall )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment