Retrieve ANSI color code from a color name, an html color or an RGB color
ground
is one of :foreground, :background color
is one of this 3 formats: name, html, rgb
# File lib/ansi_color.rb, line 12 def initialize(ground, *color) @ground = ground if color.size == 1 @color = color.first else @color = color end end
Get the ANSI color code.
# File lib/ansi_color.rb, line 23 def code case @color when Symbol then code_from_name when String then code_from_html when Array then code_from_rgb end end