Class: Sassafras::Shades

Inherits:
ColorSet show all
Defined in:
lib/sassafras.rb

Instance Method Summary collapse

Methods inherited from ColorSet

#colors, #method_missing

Constructor Details

#initialize(base_rgb, prefix = nil) ⇒ Shades

Returns a new instance of Shades.



171
172
173
174
175
176
177
178
179
# File 'lib/sassafras.rb', line 171

def initialize(base_rgb, prefix=nil)
  super(base_rgb, prefix)
  @colors = {
    'mid'     => @rgb.html,
    'dark'    => @rgb.darken_by(50).html,
    'darker'  => @rgb.darken_by(30).html,
    'darkest' => @rgb.darken_by(10).html
  }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Sassafras::ColorSet