Create a gist now

Instantly share code, notes, and snippets.

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