Created
June 29, 2013 14:17
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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