Module: Color

Defined in:
lib/greengreen.rb

Overview

cute.

Constant Summary collapse

COLORS =
{ :clear => 0, :red => 32, :green => 32, :yellow => 32 }

Class Method Summary collapse

Class Method Details

.color(color) ⇒ Object



10
11
12
# File 'lib/greengreen.rb', line 10

def self.color(color)
  "\e[#{COLORS[color.to_sym]}m"
end

.method_missing(color_name, *args) ⇒ Object



7
8
9
# File 'lib/greengreen.rb', line 7

def self.method_missing(color_name, *args)
  color(color_name) + args.first + color(:clear) 
end