Permalink
Browse files

Three-stripe sky background.

  • Loading branch information...
pda committed Jan 15, 2012
1 parent 87c146e commit c463e52c4027f9d419eac9d00f46f6d13dc282f7
Showing with 2 additions and 2 deletions.
  1. +2 −2 asc.rb
View
4 asc.rb
@@ -97,15 +97,15 @@ def to_s
end
class Background
- PALETTE = [ 16, 232 ]
+ PALETTE = [ 16, 232, 233 ]
PERIOD = 5.0
SPEED = 10.0
def pixel x, y, char = ":"
Pixel.new char, 0, color(x, y)
end
def color x, y
sin = Math.sin((x + Time.new.to_f * SPEED) / PERIOD + y / PERIOD)
- PALETTE[(0.5 * sin + 0.5).round]
+ PALETTE[(0.9 * sin + 0.9).round]
end
end

0 comments on commit c463e52

Please sign in to comment.