Method: Colorable::Color#initialize

Defined in:
lib/colorable/color.rb

#initialize(arg) ⇒ Color

Create a Color object which has several representations of a color.

arg can be:

String or Symbol of color name
String of HEX color
Array of RGB values
NAME, RGB, HSB, HEX objects

Color object has output mode, which is determined by arg type.



15
16
17
# File 'lib/colorable/color.rb', line 15

def initialize(arg)
  @name, @rgb, @hsb, @hex, @mode = set_variables(arg)
end