Class: Chroma::ColorModes::Rgb
- Inherits:
-
Object
- Object
- Chroma::ColorModes::Rgb
- Defined in:
- lib/chroma/color_modes.rb
Instance Attribute Summary collapse
-
#a ⇒ Object
Returns the value of attribute a.
-
#b ⇒ Object
Returns the value of attribute b.
-
#g ⇒ Object
Returns the value of attribute g.
-
#r ⇒ Object
Returns the value of attribute r.
Instance Method Summary collapse
-
#initialize(r, g, b, a = 1) ⇒ Rgb
constructor
A new instance of Rgb.
-
#to_a ⇒ Array<Numeric>
(also: #to_ary)
Returns the values
r
,g
,b
, anda
as an array.
Constructor Details
#initialize(r, g, b, a = 1) ⇒ Rgb
Returns a new instance of Rgb.
8 9 10 |
# File 'lib/chroma/color_modes.rb', line 8 def initialize(r, g, b, a = 1) @r, @g, @b, @a = r, g, b, a end |
Instance Attribute Details
#a ⇒ Object
Returns the value of attribute a.
2 3 4 |
# File 'lib/chroma/color_modes.rb', line 2 def a @a end |
#b ⇒ Object
Returns the value of attribute b.
2 3 4 |
# File 'lib/chroma/color_modes.rb', line 2 def b @b end |
#g ⇒ Object
Returns the value of attribute g.
2 3 4 |
# File 'lib/chroma/color_modes.rb', line 2 def g @g end |
#r ⇒ Object
Returns the value of attribute r.
2 3 4 |
# File 'lib/chroma/color_modes.rb', line 2 def r @r end |
Instance Method Details
#to_a ⇒ Array<Numeric> Also known as: to_ary
Returns the values r
, g
, b
, and a
as an array.
15 16 17 |
# File 'lib/chroma/color_modes.rb', line 15 def to_a [@r, @g, @b, @a] end |