punkmaker 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Manifest.txt +6 -0
- data/README.md +230 -160
- data/config/skintone/color_me_human.csv +78 -0
- data/config/skintone/dr_ellis_monk.csv +11 -0
- data/config/skintone/punks_not_dead.csv +39 -0
- data/config/skintone/ye_olde_punks.csv +5 -0
- data/lib/punkmaker/alien.rb +2 -2
- data/lib/punkmaker/ape.rb +1 -1
- data/lib/punkmaker/colors.rb +60 -0
- data/lib/punkmaker/demon.rb +1 -1
- data/lib/punkmaker/human.rb +27 -6
- data/lib/punkmaker/mummy.rb +2 -2
- data/lib/punkmaker/orc.rb +1 -1
- data/lib/punkmaker/robot.rb +1 -1
- data/lib/punkmaker/skeleton.rb +1 -1
- data/lib/punkmaker/skintone.rb +16 -0
- data/lib/punkmaker/vampire.rb +1 -1
- data/lib/punkmaker/version.rb +1 -1
- data/lib/punkmaker/zombie.rb +2 -2
- data/lib/punkmaker.rb +4 -0
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '069854a626106379119b3bd7013fa471c8c127201426e350da67f94848dd449c'
|
4
|
+
data.tar.gz: 7149b329b2e0e8b4b657b2ea6310906f22e868138d71985434c16ab30423e8e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7b517729f76418692c5c966ea72e698be67834bfdde19c74bbb1996f137c8c3724c08c7c1b412730ebad02708487a23f4e232dcea1b09f712605032c1cda094
|
7
|
+
data.tar.gz: fc5f30b4d5520f91fb8140cef37072042ef7b9d7be6072a7bb8e2182ad095ed00c9a11616acf18498811492a94245fcf9ac6037808f32f15c3ea749fed0754aa
|
data/CHANGELOG.md
CHANGED
data/Manifest.txt
CHANGED
@@ -18,6 +18,10 @@ config/robot-female.png
|
|
18
18
|
config/robot-male.png
|
19
19
|
config/skeleton-female.png
|
20
20
|
config/skeleton-male.png
|
21
|
+
config/skintone/color_me_human.csv
|
22
|
+
config/skintone/dr_ellis_monk.csv
|
23
|
+
config/skintone/punks_not_dead.csv
|
24
|
+
config/skintone/ye_olde_punks.csv
|
21
25
|
config/vampire-female.png
|
22
26
|
config/vampire-male.png
|
23
27
|
config/zombie-female.png
|
@@ -25,6 +29,7 @@ config/zombie-male.png
|
|
25
29
|
lib/punkmaker.rb
|
26
30
|
lib/punkmaker/alien.rb
|
27
31
|
lib/punkmaker/ape.rb
|
32
|
+
lib/punkmaker/colors.rb
|
28
33
|
lib/punkmaker/demon.rb
|
29
34
|
lib/punkmaker/hair.rb
|
30
35
|
lib/punkmaker/human.rb
|
@@ -32,6 +37,7 @@ lib/punkmaker/mummy.rb
|
|
32
37
|
lib/punkmaker/orc.rb
|
33
38
|
lib/punkmaker/robot.rb
|
34
39
|
lib/punkmaker/skeleton.rb
|
40
|
+
lib/punkmaker/skintone.rb
|
35
41
|
lib/punkmaker/vampire.rb
|
36
42
|
lib/punkmaker/version.rb
|
37
43
|
lib/punkmaker/zombie.rb
|
data/README.md
CHANGED
@@ -33,13 +33,83 @@ punk_f.zoom(4).save( 'human-female_gold@4x.png' )
|
|
33
33
|
|
34
34
|
Voila!
|
35
35
|
|
36
|
-

|
37
|
-

|
36
|
+

|
37
|
+

|
38
38
|
|
39
39
|
4x
|
40
40
|
|
41
|
-

|
42
|
-

|
41
|
+

|
42
|
+

|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
Let's try predefined skintone color names
|
47
|
+
(from
|
48
|
+
[ye olde punks](config/skintone/ye_olde_punks.csv),
|
49
|
+
[dr ellis monk](config/skintone/dr_ellis_monk.csv),
|
50
|
+
[punks not dead](config/skintone/punks_not_dead.csv), or
|
51
|
+
[color me human](config/skintone/color_me_human.csv)):
|
52
|
+
|
53
|
+
|
54
|
+
``` ruby
|
55
|
+
[
|
56
|
+
'albino', # ye olde punks
|
57
|
+
'dark',
|
58
|
+
'monk10', # dr ellis monk
|
59
|
+
'monk01',
|
60
|
+
'orange', # punk's not dead
|
61
|
+
'almond',
|
62
|
+
'sienna',
|
63
|
+
'a1', # color me human
|
64
|
+
].each do |skintone|
|
65
|
+
punk_m = Punk::Human.make( skintone, gender: 'm' )
|
66
|
+
punk_m.save( "human-male_#{skintone}.png" )
|
67
|
+
punk_m.zoom(4).save( "human-male_#{skintone}@4x.png" )
|
68
|
+
|
69
|
+
punk_f = Punk::Human.make( skintone, gender: 'f' )
|
70
|
+
punk_f.save( "human-female_#{skintone}.png" )
|
71
|
+
punk_f.zoom(4).save( "human-female_#{skintone}@4x.png" )
|
72
|
+
end
|
73
|
+
```
|
74
|
+
|
75
|
+
|
76
|
+
Voila!
|
77
|
+
|
78
|
+

|
79
|
+

|
80
|
+

|
81
|
+

|
82
|
+

|
83
|
+

|
84
|
+

|
85
|
+
 <br>
|
86
|
+

|
87
|
+

|
88
|
+

|
89
|
+

|
90
|
+

|
91
|
+

|
92
|
+

|
93
|
+

|
94
|
+
|
95
|
+
4x
|
96
|
+
|
97
|
+

|
98
|
+

|
99
|
+

|
100
|
+

|
101
|
+

|
102
|
+

|
103
|
+

|
104
|
+
 <br>
|
105
|
+

|
106
|
+

|
107
|
+

|
108
|
+

|
109
|
+

|
110
|
+

|
111
|
+

|
112
|
+

|
43
113
|
|
44
114
|
|
45
115
|
|
@@ -74,45 +144,45 @@ end
|
|
74
144
|
|
75
145
|
Voila!
|
76
146
|
|
77
|
-

|
78
|
-

|
79
|
-

|
80
|
-

|
81
|
-

|
82
|
-

|
83
|
-

|
84
|
-

|
85
|
-
 <br>
|
86
|
-

|
87
|
-

|
88
|
-

|
89
|
-

|
90
|
-

|
91
|
-

|
92
|
-

|
93
|
-

|
94
|
-

|
147
|
+

|
148
|
+

|
149
|
+

|
150
|
+

|
151
|
+

|
152
|
+

|
153
|
+

|
154
|
+

|
155
|
+
 <br>
|
156
|
+

|
157
|
+

|
158
|
+

|
159
|
+

|
160
|
+

|
161
|
+

|
162
|
+

|
163
|
+

|
164
|
+

|
95
165
|
|
96
166
|
4x
|
97
167
|
|
98
|
-

|
99
|
-

|
100
|
-

|
101
|
-

|
102
|
-

|
103
|
-

|
104
|
-

|
105
|
-

|
106
|
-
 <br>
|
107
|
-

|
108
|
-

|
109
|
-

|
110
|
-

|
111
|
-

|
112
|
-

|
113
|
-

|
114
|
-

|
115
|
-

|
168
|
+

|
169
|
+

|
170
|
+

|
171
|
+

|
172
|
+

|
173
|
+

|
174
|
+

|
175
|
+

|
176
|
+
 <br>
|
177
|
+

|
178
|
+

|
179
|
+

|
180
|
+

|
181
|
+

|
182
|
+

|
183
|
+

|
184
|
+

|
185
|
+

|
116
186
|
|
117
187
|
|
118
188
|
Let's try some more colors:
|
@@ -148,131 +218,131 @@ end
|
|
148
218
|
|
149
219
|
Voila!
|
150
220
|
|
151
|
-

|
152
|
-

|
153
|
-

|
154
|
-

|
155
|
-

|
156
|
-

|
157
|
-

|
158
|
-

|
159
|
-

|
160
|
-
 <br>
|
161
|
-

|
162
|
-

|
163
|
-

|
164
|
-

|
165
|
-

|
166
|
-

|
167
|
-

|
168
|
-

|
169
|
-

|
170
|
-
 <br>
|
171
|
-

|
172
|
-

|
173
|
-

|
174
|
-

|
175
|
-

|
176
|
-

|
177
|
-

|
178
|
-

|
179
|
-

|
180
|
-
 <br>
|
181
|
-

|
182
|
-

|
183
|
-

|
184
|
-

|
185
|
-

|
186
|
-

|
187
|
-

|
188
|
-

|
189
|
-

|
190
|
-
 <br>
|
191
|
-

|
192
|
-

|
193
|
-

|
194
|
-

|
195
|
-

|
196
|
-

|
197
|
-

|
198
|
-

|
199
|
-

|
200
|
-
 <br>
|
201
|
-

|
202
|
-

|
203
|
-

|
204
|
-

|
205
|
-

|
206
|
-

|
207
|
-

|
208
|
-

|
209
|
-

|
210
|
-

|
221
|
+

|
222
|
+

|
223
|
+

|
224
|
+

|
225
|
+

|
226
|
+

|
227
|
+

|
228
|
+

|
229
|
+

|
230
|
+
 <br>
|
231
|
+

|
232
|
+

|
233
|
+

|
234
|
+

|
235
|
+

|
236
|
+

|
237
|
+

|
238
|
+

|
239
|
+

|
240
|
+
 <br>
|
241
|
+

|
242
|
+

|
243
|
+

|
244
|
+

|
245
|
+

|
246
|
+

|
247
|
+

|
248
|
+

|
249
|
+

|
250
|
+
 <br>
|
251
|
+

|
252
|
+

|
253
|
+

|
254
|
+

|
255
|
+

|
256
|
+

|
257
|
+

|
258
|
+

|
259
|
+

|
260
|
+
 <br>
|
261
|
+

|
262
|
+

|
263
|
+

|
264
|
+

|
265
|
+

|
266
|
+

|
267
|
+

|
268
|
+

|
269
|
+

|
270
|
+
 <br>
|
271
|
+

|
272
|
+

|
273
|
+

|
274
|
+

|
275
|
+

|
276
|
+

|
277
|
+

|
278
|
+

|
279
|
+

|
280
|
+

|
211
281
|
|
212
282
|
|
213
283
|
|
214
284
|
4x
|
215
285
|
|
216
|
-

|
217
|
-

|
218
|
-

|
219
|
-

|
220
|
-

|
221
|
-

|
222
|
-

|
223
|
-

|
224
|
-

|
225
|
-
 <br>
|
226
|
-

|
227
|
-

|
228
|
-

|
229
|
-

|
230
|
-

|
231
|
-

|
232
|
-

|
233
|
-

|
234
|
-

|
235
|
-
 <br>
|
236
|
-

|
237
|
-

|
238
|
-

|
239
|
-

|
240
|
-

|
241
|
-

|
242
|
-

|
243
|
-

|
244
|
-

|
245
|
-
 <br>
|
246
|
-

|
247
|
-

|
248
|
-

|
249
|
-

|
250
|
-

|
251
|
-

|
252
|
-

|
253
|
-

|
254
|
-

|
255
|
-
 <br>
|
256
|
-

|
257
|
-

|
258
|
-

|
259
|
-

|
260
|
-

|
261
|
-

|
262
|
-

|
263
|
-

|
264
|
-

|
265
|
-
 <br>
|
266
|
-

|
267
|
-

|
268
|
-

|
269
|
-

|
270
|
-

|
271
|
-

|
272
|
-

|
273
|
-

|
274
|
-

|
275
|
-

|
286
|
+

|
287
|
+

|
288
|
+

|
289
|
+

|
290
|
+

|
291
|
+

|
292
|
+

|
293
|
+

|
294
|
+

|
295
|
+
 <br>
|
296
|
+

|
297
|
+

|
298
|
+

|
299
|
+

|
300
|
+

|
301
|
+

|
302
|
+

|
303
|
+

|
304
|
+

|
305
|
+
 <br>
|
306
|
+

|
307
|
+

|
308
|
+

|
309
|
+

|
310
|
+

|
311
|
+

|
312
|
+

|
313
|
+

|
314
|
+

|
315
|
+
 <br>
|
316
|
+

|
317
|
+

|
318
|
+

|
319
|
+

|
320
|
+

|
321
|
+

|
322
|
+

|
323
|
+

|
324
|
+

|
325
|
+
 <br>
|
326
|
+

|
327
|
+

|
328
|
+

|
329
|
+

|
330
|
+

|
331
|
+

|
332
|
+

|
333
|
+

|
334
|
+

|
335
|
+
 <br>
|
336
|
+

|
337
|
+

|
338
|
+

|
339
|
+

|
340
|
+

|
341
|
+

|
342
|
+

|
343
|
+

|
344
|
+

|
345
|
+

|
276
346
|
|
277
347
|
|
278
348
|
|
@@ -0,0 +1,78 @@
|
|
1
|
+
color, names
|
2
|
+
|
3
|
+
0xF5D7CD, A1
|
4
|
+
0xEEC9C0, A2
|
5
|
+
0xE2B6AF, A3
|
6
|
+
0xD7A89C, A4
|
7
|
+
0xCA958C, A5
|
8
|
+
0xBD877B, A6
|
9
|
+
0xAB756A, A7
|
10
|
+
0x99675A, A8
|
11
|
+
0x86574F, A9
|
12
|
+
0x6F4940, A10
|
13
|
+
0x593D37, A11
|
14
|
+
|
15
|
+
|
16
|
+
0xF3D8CE, B1
|
17
|
+
0xEDC8BE, B2
|
18
|
+
0xE3B9AC, B3
|
19
|
+
0xD5A99B, B4
|
20
|
+
0xC89784, B5
|
21
|
+
0xB88773, B6
|
22
|
+
0xA77865, B7
|
23
|
+
0x956759, B8
|
24
|
+
0x815949, B9
|
25
|
+
0x6F4B3E, B10
|
26
|
+
0x583D32, B11
|
27
|
+
|
28
|
+
|
29
|
+
0xF4DACD, C1
|
30
|
+
0xEACDBB, C2
|
31
|
+
0xDCB9A9, C3
|
32
|
+
0xD0AA95, C4
|
33
|
+
0xC69B81, C5
|
34
|
+
0xB68A70, C6
|
35
|
+
0xA4785F, C7
|
36
|
+
0x946D51, C8
|
37
|
+
0x7E5B44, C9
|
38
|
+
0x6C4D3B, C10
|
39
|
+
0x573E31, C11
|
40
|
+
|
41
|
+
|
42
|
+
0xEFDCCC, D1
|
43
|
+
0xE6CCB8, D2
|
44
|
+
0xDDBBA3, D3
|
45
|
+
0xCCA990, D4
|
46
|
+
0xC39D7F, D5
|
47
|
+
0xB28C6E, D6
|
48
|
+
0xA17B5E, D7
|
49
|
+
0x906B4E, D8
|
50
|
+
0x7D5B43, D9
|
51
|
+
0x674C38, D10
|
52
|
+
0x543F2F, D11
|
53
|
+
|
54
|
+
|
55
|
+
0xEFDBCA, E1
|
56
|
+
0xE4CBB6, E2
|
57
|
+
0xD8BCA0, E3
|
58
|
+
0xCDAC8E, E4
|
59
|
+
0xC19F7E, E5
|
60
|
+
0xAE8C6C, E6
|
61
|
+
0x9D7A5A, E7
|
62
|
+
0x8D6E4D, E8
|
63
|
+
0x7B5C40, E9
|
64
|
+
0x664D36, E10
|
65
|
+
0x52402D, E11
|
66
|
+
|
67
|
+
|
68
|
+
0xEDDBCA, F1
|
69
|
+
0xE1CCB6, F2
|
70
|
+
0xD5BDA0, F3
|
71
|
+
0xC8AC8B, F4
|
72
|
+
0xBCA17B, F5
|
73
|
+
0xAE8F6B, F6
|
74
|
+
0x997E57, F7
|
75
|
+
0x876E4B, F8
|
76
|
+
0x776040, F9
|
77
|
+
0x644F33, F10
|
78
|
+
0x52402D, F11
|
@@ -0,0 +1,11 @@
|
|
1
|
+
color, names
|
2
|
+
0xf6ede4, 01 | MST 01 | monk 01
|
3
|
+
0xf3e7db, 02 | MST 02 | monk 02
|
4
|
+
0xf7ead0, 03 | MST 03 | monk 03
|
5
|
+
0xeadaba, 04 | MST 04 | monk 04
|
6
|
+
0xd7bd96, 05 | MST 05 | monk 05
|
7
|
+
0xa07e56, 06 | MST 06 | monk 06
|
8
|
+
0x825c43, 07 | MST 07 | monk 07
|
9
|
+
0x604134, 08 | MST 08 | monk 08
|
10
|
+
0x3a312a, 09 | MST 09 | monk 09
|
11
|
+
0x292420, 10 | MST 10 | monk 10
|
@@ -0,0 +1,39 @@
|
|
1
|
+
color, names
|
2
|
+
|
3
|
+
0xE9CBA9, ivory
|
4
|
+
0xEFD1B7, porcelain
|
5
|
+
0xF7DDC2, pale ivory
|
6
|
+
0xF7E2AB, warm ivory
|
7
|
+
0xEEC695, sand
|
8
|
+
0xF1C088, rose beige
|
9
|
+
|
10
|
+
0xE5BB91, limestone
|
11
|
+
0xECBF84, beige
|
12
|
+
0xD19C7C, sienna
|
13
|
+
0xCD9564, honey
|
14
|
+
0xAD8B65, band
|
15
|
+
0x94603B, almond
|
16
|
+
|
17
|
+
0x895434, chestnut
|
18
|
+
0x78441F, bronze
|
19
|
+
0xB06949, umber
|
20
|
+
0x7F4829, golden
|
21
|
+
0x623A17, espresso
|
22
|
+
0x321F11, chocolate
|
23
|
+
|
24
|
+
|
25
|
+
0xF05423, orange
|
26
|
+
0xEF483E, warm red
|
27
|
+
0xEE3342, red
|
28
|
+
0xD51B5E, rubine red
|
29
|
+
0xda1884, pink | barbie pink
|
30
|
+
|
31
|
+
0xAA4399, purple
|
32
|
+
0x462E8D, blue
|
33
|
+
0xBC9BC9, violet
|
34
|
+
|
35
|
+
0xF8DE08, yellow
|
36
|
+
|
37
|
+
0xffd700, gold 1 | gold
|
38
|
+
0xdaa520, gold 2 | goldenrod
|
39
|
+
0xb8860b, gold 3 | darkgoldenrod
|
data/lib/punkmaker/alien.rb
CHANGED
@@ -45,7 +45,7 @@ module Alien ## make it a class - why? why not?
|
|
45
45
|
## [1.0,s+0.10].min,
|
46
46
|
## [1.0,l+0.25].min)
|
47
47
|
|
48
|
-
color = Color.
|
48
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
49
49
|
|
50
50
|
hsv = Color.to_hsv( color )
|
51
51
|
# pp hsv
|
@@ -69,7 +69,7 @@ def self.derive_color_map( color )
|
|
69
69
|
# 125 pixels #c8fbfb / rgb(200 251 251) - hsl(180° 86% 88%) - base (use as base)
|
70
70
|
# 6 pixels #9be0e0 / rgb(155 224 224) - hsl(180° 53% 74%) - darker
|
71
71
|
# 2 pixels #75bdbd / rgb(117 189 189) - hsl(180° 35% 60%) - darkest
|
72
|
-
color = Color.
|
72
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
73
73
|
base = color
|
74
74
|
|
75
75
|
hsl = Color.to_hsl( color )
|
data/lib/punkmaker/ape.rb
CHANGED
@@ -0,0 +1,60 @@
|
|
1
|
+
|
2
|
+
class ColorBundle
|
3
|
+
|
4
|
+
def self.read( *paths )
|
5
|
+
recs = []
|
6
|
+
paths.each do |path|
|
7
|
+
recs += read_csv( path )
|
8
|
+
end
|
9
|
+
new( recs )
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.normalize_key( str )
|
13
|
+
## remove all non-alphanum chars (a-z,0-9)
|
14
|
+
str.downcase.gsub(/[^a-z0-9]/, '').strip
|
15
|
+
end
|
16
|
+
def normalize_key( str ) self.class.normalize_key( str ); end
|
17
|
+
|
18
|
+
|
19
|
+
def initialize( recs )
|
20
|
+
@recs = recs
|
21
|
+
@colors_by_key = _build_colors_by_key( @recs )
|
22
|
+
end
|
23
|
+
|
24
|
+
def records() @recs; end
|
25
|
+
|
26
|
+
def find_by( name: )
|
27
|
+
key = normalize_key( name ) ## normalize q(uery) string/symbol
|
28
|
+
@colors_by_key[ key ]
|
29
|
+
end
|
30
|
+
|
31
|
+
def _find( name ) find_by( name: name ); end
|
32
|
+
alias_method :[], :_find
|
33
|
+
|
34
|
+
|
35
|
+
######
|
36
|
+
## helpers
|
37
|
+
def _build_colors_by_key( recs )
|
38
|
+
h = {}
|
39
|
+
recs.each_with_index do |rec|
|
40
|
+
|
41
|
+
color = Color.from_hex( rec['color'] )
|
42
|
+
names = (rec['names'] || '').split( '|' )
|
43
|
+
|
44
|
+
names.each do |name|
|
45
|
+
key = normalize_key( name )
|
46
|
+
|
47
|
+
if h[ key ]
|
48
|
+
puts "!!! ERROR - color name is not unique:"
|
49
|
+
pp rec
|
50
|
+
puts "duplicate:"
|
51
|
+
pp h[key]
|
52
|
+
exit 1
|
53
|
+
end
|
54
|
+
h[ key ] = color
|
55
|
+
end
|
56
|
+
end
|
57
|
+
h
|
58
|
+
end
|
59
|
+
|
60
|
+
end # class ColorBundle
|
data/lib/punkmaker/demon.rb
CHANGED
@@ -24,7 +24,7 @@ module Demon ## make it a class - why? why not?
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def self.derive_color_map( color )
|
27
|
-
color = Color.
|
27
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
28
28
|
|
29
29
|
# 134 pixels #850008 / rgb(133 0 8) - hsl(356° 100% 26%) - base
|
30
30
|
# 2 pixels #630006 / rgb( 99 0 6) - hsl(356° 100% 19%) - darker
|
data/lib/punkmaker/human.rb
CHANGED
@@ -8,6 +8,25 @@ module Human ## make it a class - why? why not?
|
|
8
8
|
BASE_F = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/human-female4.png" )
|
9
9
|
|
10
10
|
|
11
|
+
|
12
|
+
def self.parse_skintone( color ) ## lookup skintone by name or rgb(a) hex string or integer "true color"
|
13
|
+
if color.is_a?( String )
|
14
|
+
Skintone[ color ] || Color.from_hex( color )
|
15
|
+
else ## assume color is integer - assert - why? why not?
|
16
|
+
color
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.parse_eye_color( color )
|
21
|
+
if color.is_a?( String )
|
22
|
+
Color.from_hex( color )
|
23
|
+
else
|
24
|
+
color
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
|
11
30
|
def self.make( color=nil,
|
12
31
|
shine: true,
|
13
32
|
eye_color: nil,
|
@@ -18,14 +37,16 @@ module Human ## make it a class - why? why not?
|
|
18
37
|
## note: make a copy of base
|
19
38
|
punk = Image.new( base.width, base.height )
|
20
39
|
punk.compose!( base )
|
40
|
+
|
21
41
|
|
22
|
-
|
23
|
-
|
42
|
+
skintone = color ? parse_skintone( color ) : nil
|
43
|
+
if skintone ## change skin tone (& eyebrows)?
|
44
|
+
color_map = derive_color_map( skintone )
|
24
45
|
punk = punk.change_colors( color_map )
|
25
46
|
end
|
26
47
|
|
27
48
|
if eye_color ## change eye color?
|
28
|
-
eye_color =
|
49
|
+
eye_color = parse_eye_color( eye_color )
|
29
50
|
if gender == 'm'
|
30
51
|
punk[9,12] = eye_color
|
31
52
|
punk[14,12] = eye_color
|
@@ -37,7 +58,7 @@ module Human ## make it a class - why? why not?
|
|
37
58
|
|
38
59
|
if shine ## add shine?
|
39
60
|
# note: default shine color is white
|
40
|
-
shine_color =
|
61
|
+
shine_color = skintone ? derive_shine( skintone ) : 0xffffffff
|
41
62
|
if gender == 'm'
|
42
63
|
punk[9,7] = shine_color
|
43
64
|
punk[8,8] = shine_color
|
@@ -51,7 +72,7 @@ module Human ## make it a class - why? why not?
|
|
51
72
|
|
52
73
|
|
53
74
|
def self.derive_shine( color )
|
54
|
-
color = Color.
|
75
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
55
76
|
|
56
77
|
hsv = Color.to_hsv( color )
|
57
78
|
# pp hsv
|
@@ -75,7 +96,7 @@ module Human ## make it a class - why? why not?
|
|
75
96
|
## def self.derive_skintone_colors( color or base ) ???
|
76
97
|
|
77
98
|
def self.derive_color_map( color )
|
78
|
-
color = Color.
|
99
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
79
100
|
|
80
101
|
base = color
|
81
102
|
|
data/lib/punkmaker/mummy.rb
CHANGED
@@ -22,7 +22,7 @@ module Punk
|
|
22
22
|
end
|
23
23
|
|
24
24
|
if eye_color
|
25
|
-
eye_color = Color.
|
25
|
+
eye_color = Color.from_hex( eye_color ) if eye_color.is_a?( String )
|
26
26
|
|
27
27
|
if gender == 'm'
|
28
28
|
punk[9,12] = eye_color
|
@@ -37,7 +37,7 @@ module Punk
|
|
37
37
|
|
38
38
|
|
39
39
|
def self.derive_color_map( color )
|
40
|
-
color = Color.
|
40
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
41
41
|
|
42
42
|
# 385 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - α( 0%) - TRANSPARENT
|
43
43
|
# 52 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - BLACK
|
data/lib/punkmaker/orc.rb
CHANGED
@@ -23,7 +23,7 @@ module Orc ## make it a class - why? why not?
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.derive_color_map( color )
|
26
|
-
color = Color.
|
26
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
27
27
|
|
28
28
|
# 380 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - α( 0%) - TRANSPARENT
|
29
29
|
# 63 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - BLACK
|
data/lib/punkmaker/robot.rb
CHANGED
@@ -23,7 +23,7 @@ module Robot ## make it a class - why? why not?
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.derive_color_map( color )
|
26
|
-
color = Color.
|
26
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
27
27
|
|
28
28
|
# 384 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - α( 0%) - TRANSPARENT
|
29
29
|
# 74 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - BLACK
|
data/lib/punkmaker/skeleton.rb
CHANGED
@@ -22,7 +22,7 @@ module Skeleton ## make it a class - why? why not?
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.derive_color_map( color )
|
25
|
-
color = Color.
|
25
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
26
26
|
|
27
27
|
# 122 pixels #e0e0e0 / rgb(224 224 224) - hsl( 0° 0% 88%) - 8-BIT GRAYSCALE #224
|
28
28
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
module Punk
|
3
|
+
module Skintone
|
4
|
+
|
5
|
+
def self.bundle
|
6
|
+
@bundle ||= ColorBundle.read(
|
7
|
+
'./config/skintone/ye_olde_punks.csv',
|
8
|
+
'./config/skintone/color_me_human.csv',
|
9
|
+
'./config/skintone/dr_ellis_monk.csv',
|
10
|
+
'./config/skintone/punks_not_dead.csv' )
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.[]( name ) bundle.find_by( name: name ); end
|
14
|
+
end # module Skintone
|
15
|
+
end # module Punk
|
16
|
+
|
data/lib/punkmaker/vampire.rb
CHANGED
@@ -23,7 +23,7 @@ module Vampire ## make it a class - why? why not?
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.derive_color_map( color )
|
26
|
-
color = Color.
|
26
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
27
27
|
|
28
28
|
# 366 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - α( 0%) - TRANSPARENT
|
29
29
|
# 67 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - BLACK
|
data/lib/punkmaker/version.rb
CHANGED
data/lib/punkmaker/zombie.rb
CHANGED
@@ -42,7 +42,7 @@ module Zombie ## make it a class - why? why not?
|
|
42
42
|
## [1.0,s+0.10].min,
|
43
43
|
## [1.0,l+0.25].min)
|
44
44
|
|
45
|
-
color = Color.
|
45
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
46
46
|
|
47
47
|
hsv = Color.to_hsv( color )
|
48
48
|
# pp hsv
|
@@ -60,7 +60,7 @@ module Zombie ## make it a class - why? why not?
|
|
60
60
|
|
61
61
|
|
62
62
|
def self.derive_color_map( color )
|
63
|
-
color = Color.
|
63
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
64
64
|
|
65
65
|
# 2 pixels #9bbc88 / rgb(155 188 136) - hsl( 98° 28% 64%) - lighter
|
66
66
|
# 125 pixels #7da269 / rgb(125 162 105) - hsl( 99° 23% 52%) - base (use as base)
|
data/lib/punkmaker.rb
CHANGED
@@ -4,6 +4,10 @@ require 'spritesheet'
|
|
4
4
|
|
5
5
|
require_relative 'punkmaker/version' ## let version always go first
|
6
6
|
|
7
|
+
## support - move to ???
|
8
|
+
require_relative 'punkmaker/colors' ## ColorBundle (color by name lookup and mroe)
|
9
|
+
require_relative 'punkmaker/skintone'
|
10
|
+
|
7
11
|
## more base / archetypes
|
8
12
|
require_relative 'punkmaker/human'
|
9
13
|
require_relative 'punkmaker/alien'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: punkmaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
@@ -102,6 +102,10 @@ files:
|
|
102
102
|
- config/robot-male.png
|
103
103
|
- config/skeleton-female.png
|
104
104
|
- config/skeleton-male.png
|
105
|
+
- config/skintone/color_me_human.csv
|
106
|
+
- config/skintone/dr_ellis_monk.csv
|
107
|
+
- config/skintone/punks_not_dead.csv
|
108
|
+
- config/skintone/ye_olde_punks.csv
|
105
109
|
- config/vampire-female.png
|
106
110
|
- config/vampire-male.png
|
107
111
|
- config/zombie-female.png
|
@@ -109,6 +113,7 @@ files:
|
|
109
113
|
- lib/punkmaker.rb
|
110
114
|
- lib/punkmaker/alien.rb
|
111
115
|
- lib/punkmaker/ape.rb
|
116
|
+
- lib/punkmaker/colors.rb
|
112
117
|
- lib/punkmaker/demon.rb
|
113
118
|
- lib/punkmaker/hair.rb
|
114
119
|
- lib/punkmaker/human.rb
|
@@ -116,6 +121,7 @@ files:
|
|
116
121
|
- lib/punkmaker/orc.rb
|
117
122
|
- lib/punkmaker/robot.rb
|
118
123
|
- lib/punkmaker/skeleton.rb
|
124
|
+
- lib/punkmaker/skintone.rb
|
119
125
|
- lib/punkmaker/vampire.rb
|
120
126
|
- lib/punkmaker/version.rb
|
121
127
|
- lib/punkmaker/zombie.rb
|