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