Method: Color::FullPalette#initialize

Defined in:
lib/color/full_palette.rb

#initialize(hues, args = Hash.new) ⇒ FullPalette

Returns a new instance of FullPalette.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/color/full_palette.rb', line 15

def initialize(hues, args = Hash.new)
  super(args)

  # hue => saturation => brightness => rgb
  @colors = Array.new
  
  hues.each do |hue|
    (saturation_start .. saturation_end).step(saturation_step) do |sat|
      (brightness_start .. brightness_end).step(brightness_step) do |brt|
        hsb = HSB.new hue, sat / 100.0, brt / 100.0
        @colors << hsb
      end
    end
  end
end