Class: Chroma::RgbGenerator::FromHsl

Inherits:
Base
  • Object
show all
Defined in:
lib/chroma/rgb_generator/from_hsl.rb

Instance Method Summary collapse

Methods included from Helpers::Bounders

#bound01, #bound_alpha, #clamp01, #to_percentage

Constructor Details

#initialize(format, hsl) ⇒ FromHsl

Returns a new instance of FromHsl

Parameters:


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

#generateColorModes::Rgb

Generates a ColorModes::Rgb.

Returns:


13
14
15
# File 'lib/chroma/rgb_generator/from_hsl.rb', line 13

def generate
  FromHslValues.new(@format, *@hsl.to_a).generate
end