Skip to content

Instantly share code, notes, and snippets.

@ruprict
Created February 3, 2012 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruprict/1726881 to your computer and use it in GitHub Desktop.
Save ruprict/1726881 to your computer and use it in GitHub Desktop.
ROFLBALT WindowColor
class WindowColor
PALETTE = [ 16, 60 ]
PERIOD = 6.0
def pixel x, y, char = " "
Pixel.new char, 0, color(x, y)
end
def color x, y
sin = Math.sin(x / PERIOD + y / (PERIOD * 0.5))
PALETTE[(0.256 * sin + 0.256).round]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment