26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/punkmaker/type/demon.rb', line 26
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,
s,
[0.0,l-0.08].max)
darkest = Color.from_hsl(
(h+2)%360,
[0.0,s-0.05].max,
[0.0,l-0.15].max)
color_map = {
'#850008' => base,
'#630006' => darker,
'#390102' => darkest,
}
color_map
end
|