class Treefell::Color

Constants

COLORS

Public Class Methods

new(color) click to toggle source
# File lib/treefell/color.rb, line 20
def initialize(color)
  @color = color
end
rotate() click to toggle source
# File lib/treefell/color.rb, line 13
def self.rotate
  if !@colors_index || @colors_index == COLORS.length - 1
    @colors_index = -1
  end
  new(COLORS[@colors_index+=1])
end

Public Instance Methods

colorize(str) click to toggle source
# File lib/treefell/color.rb, line 24
def colorize(str)
  ::Term::ANSIColor.send(@color, str)
end