Class: Chroma::RgbGenerator::FromHsv

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

Instance Method Summary collapse

Methods included from Helpers::Bounders

#bound01, #bound_alpha, #clamp01, #to_percentage

Constructor Details

#initialize(format, hsv) ⇒ FromHsv

Returns a new instance of FromHsv

Parameters:


6
7
8
9
# File 'lib/chroma/rgb_generator/from_hsv.rb', line 6

def initialize(format, hsv)
  @format = format
  @hsv = hsv
end

Instance Method Details

#generateColorModes::Rgb

Generates a ColorModes::Rgb.

Returns:


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

def generate
  FromHsvValues.new(@format, *@hsv.to_a).generate
end