72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
# File 'lib/punkmaker/type/alien.rb', line 72
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 pp [h,s,l]
darker = Color.from_hsl(
h,
[0.0,s-0.05].max,
[0.0,l-0.10].max)
darkest = Color.from_hsl(
h,
[0.0,s-0.10].max,
[0.0,l-0.20].max)
color_map = {
'#c8fbfb' => base,
'#9be0e0' => darker,
'#75bdbd' => darkest,
}
color_map
end
|