Class: Ferrum::RGBA
- Inherits:
-
Object
- Object
- Ferrum::RGBA
- Defined in:
- lib/ferrum/rbga.rb
Instance Method Summary collapse
-
#initialize(red, green, blue, alpha) ⇒ RGBA
constructor
A new instance of RGBA.
- #to_h ⇒ Object
Constructor Details
#initialize(red, green, blue, alpha) ⇒ RGBA
Returns a new instance of RGBA.
3 4 5 6 7 8 9 10 |
# File 'lib/ferrum/rbga.rb', line 3 def initialize(red, green, blue, alpha) self.red = red self.green = green self.blue = blue self.alpha = alpha validate end |
Instance Method Details
#to_h ⇒ Object
12 13 14 |
# File 'lib/ferrum/rbga.rb', line 12 def to_h { r: red, g: green, b: blue, a: alpha } end |