public
Created

ROFLBALT WindowColor

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.