Method: Punk::Human.derive_color_map
- Defined in:
- lib/punkmaker/type/human.rb
.derive_color_map(color) ⇒ Object
todo/check:
add a derive_colors or dervice_skintones method - why? why not?
- change to name skintone_palette - why? why not?
def self.derive_skintone_colors( color or base ) ???
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/punkmaker/type/human.rb', line 102 def self.derive_color_map( color ) color = Color.from_hex( color ) if color.is_a?( String ) base = color hsl = Color.to_hsl( color ) pp hsl h, s, l = hsl h = h % 360 # make always positive (might be -50 or such) pp [h,s,l] ## sub one degree on hue on color wheel (plus +10% on lightness??) ## darker eyebrows = Color.from_hsl( h, s, [0.05, l-0.1].max) color_map = { '#ead9d9' => base, '#a58d8d' => eyebrows, } color_map end |