Class: Rainbow::Color::X11Named
- Inherits:
-
RGB
- Object
- Rainbow::Color
- Indexed
- RGB
- Rainbow::Color::X11Named
- Includes:
- X11ColorNames
- Defined in:
- lib/rainbow/color.rb
Constant Summary
Constants included from X11ColorNames
Instance Attribute Summary
Attributes inherited from RGB
Attributes inherited from Indexed
Attributes inherited from Rainbow::Color
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ground, name) ⇒ X11Named
constructor
A new instance of X11Named.
Methods inherited from RGB
Methods inherited from Indexed
Methods inherited from Rainbow::Color
Constructor Details
#initialize(ground, name) ⇒ X11Named
Returns a new instance of X11Named.
127 128 129 130 131 132 133 134 |
# File 'lib/rainbow/color.rb', line 127 def initialize(ground, name) unless X11Named.color_names.include?(name) fail ArgumentError, "Unknown color name, valid names: #{X11Named.color_names.join(', ')}" end super(ground, *NAMES[name]) end |
Class Method Details
.color_names ⇒ Object
123 124 125 |
# File 'lib/rainbow/color.rb', line 123 def self.color_names NAMES.keys end |