Class: Gdk::Color
- Inherits:
-
Object
- Object
- Gdk::Color
- Defined in:
- lib/gdk3/color.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(red, green, blue) ⇒ Color
constructor
A new instance of Color.
- #initialize_raw ⇒ Object
Constructor Details
#initialize(red, green, blue) ⇒ Color
Returns a new instance of Color.
42 43 44 45 46 47 |
# File 'lib/gdk3/color.rb', line 42 def initialize(red, green, blue) initialize_raw self.red = red self.green = green self.blue = blue end |
Class Method Details
.parse(spec) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/gdk3/color.rb', line 21 def parse(spec) succeeded, color = parse_raw(spec) unless succeeded = "Invalid color spec: <#{spec.inspect}>: " << "Color spec must be one of them: " << "\"\#rgb\", " << "\"\#rrggbb\", " << "\"\#rrggbb\", " << "\"\#rrrgggbbb\", " << "\"\#rrrrggggbbbb\", " << "\"\#fff\", " << "\"\#ffffff\", " << "\"\#fffffffff\", " << "\"\#fffffffffffff\"" raise ArgumentError, end color end |
.parse_raw ⇒ Object
20 |
# File 'lib/gdk3/color.rb', line 20 alias_method :parse_raw, :parse |
Instance Method Details
#initialize_raw ⇒ Object
41 |
# File 'lib/gdk3/color.rb', line 41 alias_method :initialize_raw, :initialize |