Class: Chroma::RgbGenerator::FromHsl
- Defined in:
- lib/chroma/rgb_generator/from_hsl.rb
Instance Method Summary collapse
-
#generate ⇒ ColorModes::Rgb
Generates a ColorModes::Rgb.
-
#initialize(format, hsl) ⇒ FromHsl
constructor
A new instance of FromHsl.
Methods included from Helpers::Bounders
#bound01, #bound_alpha, #clamp01, #to_percentage
Constructor Details
#initialize(format, hsl) ⇒ FromHsl
Returns a new instance of FromHsl.
6 7 8 9 |
# File 'lib/chroma/rgb_generator/from_hsl.rb', line 6 def initialize(format, hsl) @format = format @hsl = hsl end |
Instance Method Details
#generate ⇒ ColorModes::Rgb
Generates a ColorModes::Rgb.
13 14 15 |
# File 'lib/chroma/rgb_generator/from_hsl.rb', line 13 def generate FromHslValues.new(@format, *@hsl.to_a).generate end |