# File lib/lolcat/lol.rb, line 25 def self.rainbow(freq, i) red = Math.sin(freq*i + 0) * 127 + 128 green = Math.sin(freq*i + 2*Math::PI/3) * 127 + 128 blue = Math.sin(freq*i + 4*Math::PI/3) * 127 + 128 "#%02X%02X%02X" % [ red, green, blue ] end