Skip to content

Instantly share code, notes, and snippets.

@blakerohde
Created February 8, 2015 10:17
Show Gist options
  • Save blakerohde/83da7f2aa3463cc85c6e to your computer and use it in GitHub Desktop.
Save blakerohde/83da7f2aa3463cc85c6e to your computer and use it in GitHub Desktop.
Drawing Rainbows!
# Color hack for fun
rainbow = (
'cyan',
'blue',
'magenta',
'pink',
'red',
'orange',
'yellow',
'green',
)
rainbow_i = 0
rainbow_i_delta = -1
# Set the color...
color = rainbow[rainbow_i]
# After setting the color...
rainbow_i_delta = (-1*rainbow_i_delta) if rainbow_i==(len(rainbow)-1) or rainbow_i==0 else rainbow_i_delta
rainbow_i = rainbow_i+rainbow_i_delta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment