punkmaker 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6692eb9ea8a32eb0d6f104039bba563dec993e5bebc83b771e18095e48b5f0d
4
- data.tar.gz: 39ef67f256eba06343e750875e39627e73962cf159d2a81b3fee71c44edd041f
3
+ metadata.gz: '090cd7aef96630d9965d356c07f5ee4ee2f10646e004ce04d33b818e6f14fe9d'
4
+ data.tar.gz: 18845296d5fb06f19ade59f9b9b247bd6e8034ee1a3b9771e4144eb08e98e282
5
5
  SHA512:
6
- metadata.gz: 10e1f2e5cb734d461c66586eea4b8312c7fdf1251ca03fe9b36b37851aadf308a03fd7322d05388f45041915ece2420da40b225e1f02afd6dff0410dcd7ee201
7
- data.tar.gz: 5444664fa42726421e0ce510a69873249ac8d46b2c533dd7da118c429b49acdd1d8cc7a3b57873d660c51ad3ea6aacb12d9ae1eded5650435ff21d41f9b38ddd
6
+ metadata.gz: 9fae8313d6eb3617e4a24815dfa2ace0edd8a06ff878583425bb9611e0adea29a033ab7c143639fbfffc4c82a064b56e4e92255ca03184297870806b5e8b0794
7
+ data.tar.gz: 47ac27f962d02de05919e42b1289e4acb06723548ac66c32277f1fd0a718b62e1fd72e1accac07eeb74c49c0e6bbf9f3fb0ddd76f0b8be94093b2a762a97f4fd
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.2.0
1
+ ### 0.3.0
2
2
  ### 0.0.1 / 2023-04-20
3
3
 
4
4
  * Everything is new. First release
data/Manifest.txt CHANGED
@@ -2,12 +2,36 @@ CHANGELOG.md
2
2
  Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
+ config/alien-female.png
6
+ config/alien-male.png
7
+ config/ape-female.png
8
+ config/ape-male.png
9
+ config/demon-female.png
10
+ config/demon-male.png
5
11
  config/human-female4.png
6
12
  config/human-male4.png
7
13
  config/mummy-female.png
8
14
  config/mummy-male.png
15
+ config/orc-female.png
16
+ config/orc-male.png
17
+ config/robot-female.png
18
+ config/robot-male.png
19
+ config/skeleton-female.png
20
+ config/skeleton-male.png
21
+ config/vampire-female.png
22
+ config/vampire-male.png
23
+ config/zombie-female.png
24
+ config/zombie-male.png
9
25
  lib/punkmaker.rb
26
+ lib/punkmaker/alien.rb
27
+ lib/punkmaker/ape.rb
28
+ lib/punkmaker/demon.rb
10
29
  lib/punkmaker/hair.rb
11
30
  lib/punkmaker/human.rb
12
31
  lib/punkmaker/mummy.rb
32
+ lib/punkmaker/orc.rb
33
+ lib/punkmaker/robot.rb
34
+ lib/punkmaker/skeleton.rb
35
+ lib/punkmaker/vampire.rb
13
36
  lib/punkmaker/version.rb
37
+ lib/punkmaker/zombie.rb
data/README.md CHANGED
@@ -11,6 +11,7 @@ punkmaker gem - make your own (pixel) punk base (archetype) heads incl. humans,
11
11
 
12
12
 
13
13
 
14
+
14
15
  ## Usage
15
16
 
16
17
  Let's make golden punks...
@@ -20,8 +21,6 @@ require 'punkmaker'
20
21
 
21
22
  GOLD = '#ffd700'
22
23
 
23
- ###
24
- # humans
25
24
  punk_m = Punk::Human.make( GOLD, gender: 'm' )
26
25
  punk_m.save( 'human-male_gold.png' )
27
26
  punk_m.zoom(4).save( 'human-male_gold@4x.png' )
@@ -29,16 +28,6 @@ punk_m.zoom(4).save( 'human-male_gold@4x.png' )
29
28
  punk_f = Punk::Human.make( GOLD, gender: 'f' )
30
29
  punk_f.save( 'human-female_gold.png' )
31
30
  punk_f.zoom(4).save( 'human-female_gold@4x.png' )
32
-
33
- ###
34
- # mummies
35
- punk_m = Punk::Mummy.make( GOLD, gender: 'm' )
36
- punk_m.save( 'mummy-male_gold.png' )
37
- punk_m.zoom(4).save( 'mummy-male_gold@4x.png' )
38
-
39
- punk_f = Punk::Mummy.make( GOLD, gender: 'f' )
40
- punk_f.save( 'mummy-female_gold.png' )
41
- punk_f.zoom(4).save( 'mummy-female_gold@4x.png' )
42
31
  ```
43
32
 
44
33
 
@@ -47,17 +36,247 @@ Voila!
47
36
  ![](i/human-male_gold.png)
48
37
  ![](i/human-female_gold.png)
49
38
 
50
- ![](i/mummy-male_gold.png)
51
- ![](i/mummy-female_gold.png)
52
-
53
39
  4x
54
40
 
55
41
  ![](i/human-male_gold@4x.png)
56
42
  ![](i/human-female_gold@4x.png)
57
43
 
58
- ![](i/mummy-male_gold@4x.png)
44
+
45
+
46
+ Let's try some more base (arche)types:
47
+
48
+ ``` ruby
49
+ types = [
50
+ Punk::Mummy,
51
+ Punk::Alien,
52
+ Punk::Ape,
53
+ Punk::Skeleton,
54
+ Punk::Zombie,
55
+ Punk::Demon,
56
+ Punk::Orc,
57
+ Punk::Robot,
58
+ Punk::Vampire,
59
+ ]
60
+
61
+ types.each do |type|
62
+ ## get last name e.g. Orc from Punk::Orc
63
+ name = type.name.split('::')[-1].downcase
64
+
65
+ punk_m = type.make( GOLD, gender: 'm' )
66
+ punk_m.save( "#{name}-male_gold.png" )
67
+ punk_m.zoom(4).save( "#{name}-male_gold@4x.png" )
68
+
69
+ punk_f = type.make( GOLD, gender: 'f' )
70
+ punk_f.save( "#{name}-female_gold.png" )
71
+ punk_f.zoom(4).save( "#{name}-female_gold@4x.png" )
72
+ end
73
+ ```
74
+
75
+ Voila!
76
+
77
+ ![](i/mummy-male_gold.png)
78
+ ![](i/alien-male_gold.png)
79
+ ![](i/ape-male_gold.png)
80
+ ![](i/skeleton-male_gold.png)
81
+ ![](i/zombie-male_gold.png)
82
+ ![](i/demon-male_gold.png)
83
+ ![](i/orc-male_gold.png)
84
+ ![](i/robot-male_gold.png)
85
+ ![](i/vampire-male_gold.png) <br>
86
+ ![](i/mummy-female_gold.png)
87
+ ![](i/alien-female_gold.png)
88
+ ![](i/ape-female_gold.png)
89
+ ![](i/skeleton-female_gold.png)
90
+ ![](i/zombie-female_gold.png)
91
+ ![](i/demon-female_gold.png)
92
+ ![](i/orc-female_gold.png)
93
+ ![](i/robot-female_gold.png)
94
+ ![](i/vampire-female_gold.png)
95
+
96
+ 4x
97
+
98
+ ![](i/mummy-male_gold@4x.png)
99
+ ![](i/alien-male_gold@4x.png)
100
+ ![](i/ape-male_gold@4x.png)
101
+ ![](i/skeleton-male_gold@4x.png)
102
+ ![](i/zombie-male_gold@4x.png)
103
+ ![](i/demon-male_gold@4x.png)
104
+ ![](i/orc-male_gold@4x.png)
105
+ ![](i/robot-male_gold@4x.png)
106
+ ![](i/vampire-male_gold@4x.png) <br>
59
107
  ![](i/mummy-female_gold@4x.png)
108
+ ![](i/alien-female_gold@4x.png)
109
+ ![](i/ape-female_gold@4x.png)
110
+ ![](i/skeleton-female_gold@4x.png)
111
+ ![](i/zombie-female_gold@4x.png)
112
+ ![](i/demon-female_gold@4x.png)
113
+ ![](i/orc-female_gold@4x.png)
114
+ ![](i/robot-female_gold@4x.png)
115
+ ![](i/vampire-female_gold@4x.png)
116
+
117
+
118
+ Let's try some more colors:
119
+
120
+ ```ruby
121
+ NEONGREEN = '#c3ff00'
122
+ DEEPPINK = '#ff1493'
123
+ DEEPPURPLE = '#aa4399'
124
+
125
+
126
+ colors = {
127
+ 'green' => NEONGREEN,
128
+ 'pink' => DEEPPINK,
129
+ 'purple' => DEEPPURPLE,
130
+ }
131
+
132
+ types = [Punk::Human]+types ## add human first
133
+
134
+ types.each do |type|
135
+ ## get last name e.g. Orc from Punk::Orc
136
+ name = type.name.split('::')[-1].downcase
137
+ colors.each do |color_name, color|
138
+ punk_m = type.make( color, gender: 'm' )
139
+ punk_m.save( "#{name}-male_#{color_name}.png" )
140
+ punk_m.zoom(4).save( "#{name}-male_#{color_name}@4x.png" )
141
+
142
+ punk_f = type.make( color, gender: 'f' )
143
+ punk_f.save( "#{name}-female_#{color_name}.png" )
144
+ punk_f.zoom(4).save( "#{name}-female_#{color_name}@4x.png" )
145
+ end
146
+ end
147
+ ```
148
+
149
+ Voila!
150
+
151
+ ![](i/human-male_green.png)
152
+ ![](i/mummy-male_green.png)
153
+ ![](i/alien-male_green.png)
154
+ ![](i/ape-male_green.png)
155
+ ![](i/skeleton-male_green.png)
156
+ ![](i/zombie-male_green.png)
157
+ ![](i/demon-male_green.png)
158
+ ![](i/orc-male_green.png)
159
+ ![](i/robot-male_green.png)
160
+ ![](i/vampire-male_green.png) <br>
161
+ ![](i/human-female_green.png)
162
+ ![](i/mummy-female_green.png)
163
+ ![](i/alien-female_green.png)
164
+ ![](i/ape-female_green.png)
165
+ ![](i/skeleton-female_green.png)
166
+ ![](i/zombie-female_green.png)
167
+ ![](i/demon-female_green.png)
168
+ ![](i/orc-female_green.png)
169
+ ![](i/robot-female_green.png)
170
+ ![](i/vampire-female_green.png) <br>
171
+ ![](i/human-male_pink.png)
172
+ ![](i/mummy-male_pink.png)
173
+ ![](i/alien-male_pink.png)
174
+ ![](i/ape-male_pink.png)
175
+ ![](i/skeleton-male_pink.png)
176
+ ![](i/zombie-male_pink.png)
177
+ ![](i/demon-male_pink.png)
178
+ ![](i/orc-male_pink.png)
179
+ ![](i/robot-male_pink.png)
180
+ ![](i/vampire-male_pink.png) <br>
181
+ ![](i/human-female_pink.png)
182
+ ![](i/mummy-female_pink.png)
183
+ ![](i/alien-female_pink.png)
184
+ ![](i/ape-female_pink.png)
185
+ ![](i/skeleton-female_pink.png)
186
+ ![](i/zombie-female_pink.png)
187
+ ![](i/demon-female_pink.png)
188
+ ![](i/orc-female_pink.png)
189
+ ![](i/robot-female_pink.png)
190
+ ![](i/vampire-female_pink.png) <br>
191
+ ![](i/human-male_purple.png)
192
+ ![](i/mummy-male_purple.png)
193
+ ![](i/alien-male_purple.png)
194
+ ![](i/ape-male_purple.png)
195
+ ![](i/skeleton-male_purple.png)
196
+ ![](i/zombie-male_purple.png)
197
+ ![](i/demon-male_purple.png)
198
+ ![](i/orc-male_purple.png)
199
+ ![](i/robot-male_purple.png)
200
+ ![](i/vampire-male_purple.png) <br>
201
+ ![](i/human-female_purple.png)
202
+ ![](i/mummy-female_purple.png)
203
+ ![](i/alien-female_purple.png)
204
+ ![](i/ape-female_purple.png)
205
+ ![](i/skeleton-female_purple.png)
206
+ ![](i/zombie-female_purple.png)
207
+ ![](i/demon-female_purple.png)
208
+ ![](i/orc-female_purple.png)
209
+ ![](i/robot-female_purple.png)
210
+ ![](i/vampire-female_purple.png)
211
+
212
+
213
+
214
+ 4x
60
215
 
216
+ ![](i/human-male_green@4x.png)
217
+ ![](i/mummy-male_green@4x.png)
218
+ ![](i/alien-male_green@4x.png)
219
+ ![](i/ape-male_green@4x.png)
220
+ ![](i/skeleton-male_green@4x.png)
221
+ ![](i/zombie-male_green@4x.png)
222
+ ![](i/demon-male_green@4x.png)
223
+ ![](i/orc-male_green@4x.png)
224
+ ![](i/robot-male_green@4x.png)
225
+ ![](i/vampire-male_green@4x.png) <br>
226
+ ![](i/human-female_green@4x.png)
227
+ ![](i/mummy-female_green@4x.png)
228
+ ![](i/alien-female_green@4x.png)
229
+ ![](i/ape-female_green@4x.png)
230
+ ![](i/skeleton-female_green@4x.png)
231
+ ![](i/zombie-female_green@4x.png)
232
+ ![](i/demon-female_green@4x.png)
233
+ ![](i/orc-female_green@4x.png)
234
+ ![](i/robot-female_green@4x.png)
235
+ ![](i/vampire-female_green@4x.png) <br>
236
+ ![](i/human-male_pink@4x.png)
237
+ ![](i/mummy-male_pink@4x.png)
238
+ ![](i/alien-male_pink@4x.png)
239
+ ![](i/ape-male_pink@4x.png)
240
+ ![](i/skeleton-male_pink@4x.png)
241
+ ![](i/zombie-male_pink@4x.png)
242
+ ![](i/demon-male_pink@4x.png)
243
+ ![](i/orc-male_pink@4x.png)
244
+ ![](i/robot-male_pink@4x.png)
245
+ ![](i/vampire-male_pink@4x.png) <br>
246
+ ![](i/human-female_pink@4x.png)
247
+ ![](i/mummy-female_pink@4x.png)
248
+ ![](i/alien-female_pink@4x.png)
249
+ ![](i/ape-female_pink@4x.png)
250
+ ![](i/skeleton-female_pink@4x.png)
251
+ ![](i/zombie-female_pink@4x.png)
252
+ ![](i/demon-female_pink@4x.png)
253
+ ![](i/orc-female_pink@4x.png)
254
+ ![](i/robot-female_pink@4x.png)
255
+ ![](i/vampire-female_pink@4x.png) <br>
256
+ ![](i/human-male_purple@4x.png)
257
+ ![](i/mummy-male_purple@4x.png)
258
+ ![](i/alien-male_purple@4x.png)
259
+ ![](i/ape-male_purple@4x.png)
260
+ ![](i/skeleton-male_purple@4x.png)
261
+ ![](i/zombie-male_purple@4x.png)
262
+ ![](i/demon-male_purple@4x.png)
263
+ ![](i/orc-male_purple@4x.png)
264
+ ![](i/robot-male_purple@4x.png)
265
+ ![](i/vampire-male_purple@4x.png) <br>
266
+ ![](i/human-female_purple@4x.png)
267
+ ![](i/mummy-female_purple@4x.png)
268
+ ![](i/alien-female_purple@4x.png)
269
+ ![](i/ape-female_purple@4x.png)
270
+ ![](i/skeleton-female_purple@4x.png)
271
+ ![](i/zombie-female_purple@4x.png)
272
+ ![](i/demon-female_purple@4x.png)
273
+ ![](i/orc-female_purple@4x.png)
274
+ ![](i/robot-female_purple@4x.png)
275
+ ![](i/vampire-female_purple@4x.png)
276
+
277
+
278
+
279
+ That's it.
61
280
 
62
281
 
63
282
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,71 @@
1
+
2
+
3
+ module Punk
4
+
5
+ module Alien ## make it a class - why? why not?
6
+
7
+ BASE_M = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/alien-male.png" )
8
+ BASE_F = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/alien-female.png" )
9
+
10
+
11
+ def self.make( color,
12
+ gender: 'm' )
13
+ color_map = derive_color_map( color )
14
+
15
+ punk = nil
16
+ if gender == 'm'
17
+ punk = BASE_M.change_colors( color_map )
18
+ else
19
+ punk = BASE_F.change_colors( color_map )
20
+ end
21
+ punk
22
+ end
23
+
24
+
25
+ def self.derive_color_map( color )
26
+
27
+ # 2 pixels #f1ffff / rgb(241 255 255) - hsl(180° 100% 97%) - lighter
28
+ # 125 pixels #c8fbfb / rgb(200 251 251) - hsl(180° 86% 88%) - base (use as base)
29
+ # 6 pixels #9be0e0 / rgb(155 224 224) - hsl(180° 53% 74%) - darker
30
+ # 2 pixels #75bdbd / rgb(117 189 189) - hsl(180° 35% 60%) - darkest
31
+ color = Color.parse( color ) if color.is_a?( String )
32
+ base = color
33
+
34
+ hsl = Color.to_hsl( color )
35
+ pp hsl
36
+
37
+ h, s, l = hsl
38
+ h = h % 360 # make always positive (might be -50 or such)
39
+ pp [h,s,l]
40
+
41
+ ## todo/check - check "formula" used in skintones script for humans!!!
42
+ lighter = Color.from_hsl(
43
+ (h+1)%360, # todo/check: make lighter by -1 on hue? or +1????
44
+ [1.0,s+0.10].min,
45
+ [1.0,l+0.25].min)
46
+
47
+
48
+ darker = Color.from_hsl(
49
+ h,
50
+ [0.0,s-0.05].max,
51
+ [0.0,l-0.10].max)
52
+
53
+ darkest = Color.from_hsl(
54
+ h,
55
+ [0.0,s-0.10].max,
56
+ [0.0,l-0.20].max)
57
+
58
+
59
+ color_map = {
60
+ '#c8fbfb' => base,
61
+ '#f1ffff' => lighter,
62
+ '#9be0e0' => darker,
63
+ '#75bdbd' => darkest,
64
+ }
65
+
66
+ color_map
67
+ end
68
+
69
+ end # module Alien
70
+ end # module Punk
71
+
@@ -0,0 +1,60 @@
1
+ module Punk
2
+
3
+
4
+ module Ape ## make it a class - why? why not?
5
+
6
+ BASE_M = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/ape-male.png" )
7
+ BASE_F = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/ape-female.png" )
8
+
9
+ def self.make( color,
10
+ gender: 'm' )
11
+ color_map = derive_color_map( color )
12
+
13
+ punk = nil
14
+ if gender == 'm'
15
+ punk = BASE_M.change_colors( color_map )
16
+ else
17
+ punk = BASE_F.change_colors( color_map )
18
+ end
19
+ punk
20
+ end
21
+
22
+ def self.derive_color_map( color )
23
+ color = Color.parse( color ) if color.is_a?( String )
24
+
25
+ darkest = color
26
+
27
+ hsl = Color.to_hsl( color )
28
+ pp hsl
29
+
30
+ h, s, l = hsl
31
+ h = h % 360 # make always positive (might be -50 or such)
32
+ pp [h,s,l]
33
+
34
+ darker = Color.from_hsl(
35
+ h,
36
+ s,
37
+ [1.0,l+0.05].min)
38
+
39
+ light = Color.from_hsl(
40
+ (h+1)%360,
41
+ [1.0,s+0.10].min,
42
+ [1.0,l+0.20].min)
43
+
44
+ lighter = Color.from_hsl(
45
+ (h+1)%360,
46
+ [1.0,s+0.20].min,
47
+ [1.0,l+0.35].min)
48
+
49
+ color_map = {
50
+ '#352410' => darkest, # darkest - 56 pixels (base!!)
51
+ '#6a563f' => darker, # darker - 4 pixels
52
+ '#856f56' => light, # light - 63 pixels
53
+ '#a98c6b' => lighter # lighter
54
+ }
55
+
56
+ color_map
57
+ end
58
+ end # module Ape
59
+ end # module Punk
60
+
@@ -0,0 +1,61 @@
1
+ module Punk
2
+
3
+
4
+ module Demon ## make it a class - why? why not?
5
+
6
+ BASE_M = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/demon-male.png" )
7
+ BASE_F = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/demon-female.png" )
8
+
9
+ def self.make( color,
10
+ gender: 'm' )
11
+ color_map = derive_color_map( color )
12
+
13
+ punk = nil
14
+ if gender == 'm'
15
+ punk = BASE_M.change_colors( color_map )
16
+ else
17
+ punk = BASE_F.change_colors( color_map )
18
+ end
19
+ punk
20
+ end
21
+
22
+ def self.derive_color_map( color )
23
+ color = Color.parse( color ) if color.is_a?( String )
24
+
25
+ # 134 pixels #850008 / rgb(133 0 8) - hsl(356° 100% 26%) - base
26
+ # 2 pixels #630006 / rgb( 99 0 6) - hsl(356° 100% 19%) - darker
27
+ # 4 pixels #390102 / rgb( 57 1 2) - hsl(359° 97% 11%) - darkest
28
+ #
29
+ # 373 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - α( 0%) - TRANSPARENT
30
+ # 63 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - BLACK
31
+
32
+ base = color
33
+
34
+ hsl = Color.to_hsl( color )
35
+ pp hsl
36
+
37
+ h, s, l = hsl
38
+ h = h % 360 # make always positive (might be -50 or such)
39
+ pp [h,s,l]
40
+
41
+ darker = Color.from_hsl(
42
+ h,
43
+ s,
44
+ [0.0,l-0.08].max)
45
+
46
+ darkest = Color.from_hsl(
47
+ (h+2)%360,
48
+ [0.0,s-0.05].max,
49
+ [0.0,l-0.15].max)
50
+
51
+
52
+ color_map = {
53
+ '#850008' => base,
54
+ '#630006' => darker,
55
+ '#390102' => darkest,
56
+ }
57
+
58
+ color_map
59
+ end
60
+ end # module Demon
61
+ end # module Punk
@@ -40,6 +40,13 @@ module Human ## make it a class - why? why not?
40
40
  end
41
41
 
42
42
 
43
+ ##
44
+ ## todo/check:
45
+ ## add a derive_colors or dervice_skintones method - why? why not?
46
+ ## - change to name skintone_palette - why? why not?
47
+ ## def self.derive_skintone_colors( color or base ) ???
48
+
49
+
43
50
  def self.derive_color_map( color )
44
51
  color = Color.parse( color ) if color.is_a?( String )
45
52
 
@@ -0,0 +1,62 @@
1
+ module Punk
2
+
3
+
4
+ module Orc ## make it a class - why? why not?
5
+
6
+ BASE_M = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/orc-male.png" )
7
+ BASE_F = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/orc-female.png" )
8
+
9
+ def self.make( color,
10
+ gender: 'm' )
11
+ color_map = derive_color_map( color )
12
+
13
+ punk = nil
14
+ if gender == 'm'
15
+ punk = BASE_M.change_colors( color_map )
16
+ else
17
+ punk = BASE_F.change_colors( color_map )
18
+ end
19
+ punk
20
+ end
21
+
22
+ def self.derive_color_map( color )
23
+ color = Color.parse( color ) if color.is_a?( String )
24
+
25
+ # 380 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - α( 0%) - TRANSPARENT
26
+ # 63 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - BLACK
27
+ # 120 pixels #50650e / rgb( 80 101 14) - hsl( 74° 76% 23%) - hsv( 74° 86% 40%)
28
+ # 7 pixels #171a08 / rgb( 23 26 8) - hsl( 70° 53% 7%) - hsv( 70° 69% 10%)
29
+ # 6 pixels #ffffff / rgb(255 255 255) - hsl( 0° 0% 100%) - hsv( 0° 0% 100%) - WHITE
30
+ # ---
31
+ # 423 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - α( 0%) - TRANSPARENT
32
+ # 55 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - BLACK
33
+ # 87 pixels #50650e / rgb( 80 101 14) - hsl( 74° 76% 23%) - hsv( 74° 86% 40%)
34
+ # 7 pixels #171a08 / rgb( 23 26 8) - hsl( 70° 53% 7%) - hsv( 70° 69% 10%)
35
+ # 4 pixels #ffffff / rgb(255 255 255) - hsl( 0° 0% 100%) - hsv( 0° 0% 100%) - WHITE
36
+ base = color
37
+
38
+ hsl = Color.to_hsl( color )
39
+ pp hsl
40
+
41
+ h, s, l = hsl
42
+ h = h % 360 # make always positive (might be -50 or such)
43
+ pp [h,s,l]
44
+
45
+
46
+ darker = Color.from_hsl(
47
+ h,
48
+ s,
49
+ [0.0,l-0.16].max)
50
+
51
+
52
+
53
+ color_map = {
54
+ '#50650e' => base,
55
+ '#171a08' => darker,
56
+ }
57
+
58
+ color_map
59
+ end
60
+ end # module Orc
61
+ end # module Punk
62
+
@@ -0,0 +1,63 @@
1
+ module Punk
2
+
3
+
4
+ module Robot ## make it a class - why? why not?
5
+
6
+ BASE_M = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/robot-male.png" )
7
+ BASE_F = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/robot-female.png" )
8
+
9
+ def self.make( color,
10
+ gender: 'm' )
11
+ color_map = derive_color_map( color )
12
+
13
+ punk = nil
14
+ if gender == 'm'
15
+ punk = BASE_M.change_colors( color_map )
16
+ else
17
+ punk = BASE_F.change_colors( color_map )
18
+ end
19
+ punk
20
+ end
21
+
22
+ def self.derive_color_map( color )
23
+ color = Color.parse( color ) if color.is_a?( String )
24
+
25
+ # 384 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - α( 0%) - TRANSPARENT
26
+ # 74 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - BLACK
27
+ # 100 pixels #a4a4a4 / rgb(164 164 164) - hsl( 0° 0% 64%) - hsv( 0° 0% 64%) - 8-BIT GRAYSCALE #164
28
+ # 16 pixels #535353 / rgb( 83 83 83) - hsl( 0° 0% 33%) - hsv( 0° 0% 33%) - 8-BIT GRAYSCALE #83
29
+ # 2 pixels #a9f7ff / rgb(169 247 255) - hsl(186° 100% 83%) - hsv(186° 34% 100%)
30
+ # ---
31
+ # 427 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - α( 0%) - TRANSPARENT
32
+ # 65 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - BLACK
33
+ # 67 pixels #a4a4a4 / rgb(164 164 164) - hsl( 0° 0% 64%) - hsv( 0° 0% 64%) - 8-BIT GRAYSCALE #164
34
+ # 15 pixels #535353 / rgb( 83 83 83) - hsl( 0° 0% 33%) - hsv( 0° 0% 33%) - 8-BIT GRAYSCALE #83
35
+ # 2 pixels #a9f7ff / rgb(169 247 255) - hsl(186° 100% 83%) - hsv(186° 34% 100%)
36
+
37
+ base = color
38
+
39
+ hsl = Color.to_hsl( color )
40
+ pp hsl
41
+
42
+ h, s, l = hsl
43
+ h = h % 360 # make always positive (might be -50 or such)
44
+ pp [h,s,l]
45
+
46
+
47
+ darker = Color.from_hsl(
48
+ h,
49
+ s,
50
+ [0.0,l-0.20].max)
51
+
52
+ color_map = {
53
+ '#a4a4a4' => base,
54
+ '#535353' => darker,
55
+ }
56
+
57
+ color_map
58
+ end
59
+ end # module Robot
60
+ end # module Punk
61
+
62
+
63
+
@@ -0,0 +1,39 @@
1
+ module Punk
2
+
3
+ module Skeleton ## make it a class - why? why not?
4
+
5
+ BASE_M = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/skeleton-male.png" )
6
+ BASE_F = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/skeleton-female.png" )
7
+
8
+ def self.make( color,
9
+ gender: 'm' )
10
+ color_map = derive_color_map( color )
11
+
12
+ punk = nil
13
+ if gender == 'm'
14
+ punk = BASE_M.change_colors( color_map )
15
+ else
16
+ punk = BASE_F.change_colors( color_map )
17
+ end
18
+ punk
19
+ end
20
+
21
+ def self.derive_color_map( color )
22
+ color = Color.parse( color ) if color.is_a?( String )
23
+
24
+ # 122 pixels #e0e0e0 / rgb(224 224 224) - hsl( 0° 0% 88%) - 8-BIT GRAYSCALE #224
25
+
26
+ # 385 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - α( 0%) - TRANSPARENT
27
+ # 69 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - BLACK
28
+
29
+ base = color
30
+
31
+ color_map = {
32
+ '#e0e0e0' => base,
33
+ }
34
+
35
+ color_map
36
+ end
37
+ end # module Skeleton
38
+ end # module Punk
39
+
@@ -0,0 +1,71 @@
1
+ module Punk
2
+
3
+
4
+ module Vampire ## make it a class - why? why not?
5
+
6
+ BASE_M = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/vampire-male.png" )
7
+ BASE_F = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/vampire-female.png" )
8
+
9
+ def self.make( color,
10
+ gender: 'm' )
11
+ color_map = derive_color_map( color )
12
+
13
+ punk = nil
14
+ if gender == 'm'
15
+ punk = BASE_M.change_colors( color_map )
16
+ else
17
+ punk = BASE_F.change_colors( color_map )
18
+ end
19
+ punk
20
+ end
21
+
22
+ def self.derive_color_map( color )
23
+ color = Color.parse( color ) if color.is_a?( String )
24
+
25
+ # 366 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - α( 0%) - TRANSPARENT
26
+ # 67 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - BLACK
27
+ # 126 pixels #e0e0e0 / rgb(224 224 224) - hsl( 0° 0% 88%) - hsv( 0° 0% 88%) - 8-BIT GRAYSCALE #224
28
+ # 4 pixels #535353 / rgb( 83 83 83) - hsl( 0° 0% 33%) - hsv( 0° 0% 33%) - 8-BIT GRAYSCALE #83
29
+ # 2 pixels #ffffff / rgb(255 255 255) - hsl( 0° 0% 100%) - hsv( 0° 0% 100%) - WHITE
30
+ # 2 pixels #f6000b / rgb(246 0 11) - hsl(357° 100% 48%) - hsv(357° 100% 96%)
31
+ # 9 pixels #131313 / rgb( 19 19 19) - hsl( 0° 0% 7%) - hsv( 0° 0% 7%) - 8-BIT GRAYSCALE #19
32
+ # ---
33
+ # 403 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - α( 0%) - TRANSPARENT
34
+ # 62 pixels #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%) - BLACK
35
+ # 92 pixels #e0e0e0 / rgb(224 224 224) - hsl( 0° 0% 88%) - hsv( 0° 0% 88%) - 8-BIT GRAYSCALE #224
36
+ # 4 pixels #535353 / rgb( 83 83 83) - hsl( 0° 0% 33%) - hsv( 0° 0% 33%) - 8-BIT GRAYSCALE #83
37
+ # 2 pixels #ffffff / rgb(255 255 255) - hsl( 0° 0% 100%) - hsv( 0° 0% 100%) - WHITE
38
+ # 2 pixels #f6000b / rgb(246 0 11) - hsl(357° 100% 48%) - hsv(357° 100% 96%)
39
+ # 11 pixels #131313 / rgb( 19 19 19) - hsl( 0° 0% 7%) - hsv( 0° 0% 7%) - 8-BIT GRAYSCALE #19
40
+ base = color
41
+
42
+ hsl = Color.to_hsl( color )
43
+ pp hsl
44
+
45
+ h, s, l = hsl
46
+ h = h % 360 # make always positive (might be -50 or such)
47
+ pp [h,s,l]
48
+
49
+
50
+ darker = Color.from_hsl(
51
+ h,
52
+ s,
53
+ [0.0,l-0.20].max)
54
+
55
+
56
+ darkest = Color.from_hsl(
57
+ h,
58
+ s,
59
+ [0.0,l-0.35].max)
60
+
61
+ color_map = {
62
+ '#e0e0e0' => base,
63
+ '#535353' => darker,
64
+ '#131313' => darkest,
65
+ }
66
+
67
+ color_map
68
+ end
69
+ end # module Vampire
70
+ end # module Punk
71
+
@@ -2,7 +2,7 @@ module Pixelart
2
2
  module Module
3
3
  module Punkmaker
4
4
  MAJOR = 0
5
- MINOR = 2
5
+ MINOR = 3
6
6
  PATCH = 0
7
7
  VERSION = [MAJOR,MINOR,PATCH].join('.')
8
8
 
@@ -0,0 +1,61 @@
1
+ module Punk
2
+
3
+
4
+ module Zombie ## make it a class - why? why not?
5
+
6
+ BASE_M = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/zombie-male.png" )
7
+ BASE_F = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/zombie-female.png" )
8
+
9
+ def self.make( color,
10
+ gender: 'm' )
11
+ color_map = derive_color_map( color )
12
+
13
+ punk = nil
14
+ if gender == 'm'
15
+ punk = BASE_M.change_colors( color_map )
16
+ else
17
+ punk = BASE_F.change_colors( color_map )
18
+ end
19
+ punk
20
+ end
21
+
22
+ def self.derive_color_map( color )
23
+ color = Color.parse( color ) if color.is_a?( String )
24
+
25
+ # 2 pixels #9bbc88 / rgb(155 188 136) - hsl( 98° 28% 64%) - lighter
26
+ # 125 pixels #7da269 / rgb(125 162 105) - hsl( 99° 23% 52%) - base (use as base)
27
+ # 7 pixels #5e7253 / rgb( 94 114 83) - hsl( 99° 16% 39%) - darker
28
+
29
+ base = color
30
+
31
+ hsl = Color.to_hsl( color )
32
+ pp hsl
33
+
34
+ h, s, l = hsl
35
+ h = h % 360 # make always positive (might be -50 or such)
36
+ pp [h,s,l]
37
+
38
+ darker = Color.from_hsl(
39
+ h,
40
+ [0.0,s-0.05].max,
41
+ [0.0,l-0.12].max)
42
+
43
+ ## todo/check - check "formula" used in skintones script for humans!!!
44
+ lighter = Color.from_hsl(
45
+ (h+1)%360, # todo/check: make lighter by -1 on hue? or +1????
46
+ [1.0,s+0.10].min,
47
+ [1.0,l+0.25].min)
48
+
49
+
50
+ color_map = {
51
+ '#7da269' => base,
52
+ '#5e7253' => darker,
53
+ '#9bbc88' => lighter
54
+ }
55
+
56
+ color_map
57
+ end
58
+ end # module Zombie
59
+ end # module Punk
60
+
61
+
data/lib/punkmaker.rb CHANGED
@@ -3,9 +3,19 @@ require 'spritesheet'
3
3
 
4
4
 
5
5
  require_relative 'punkmaker/version' ## let version always go first
6
+
6
7
  ## more base / archetypes
7
8
  require_relative 'punkmaker/human'
9
+ require_relative 'punkmaker/alien'
8
10
  require_relative 'punkmaker/mummy'
11
+ require_relative 'punkmaker/ape'
12
+ require_relative 'punkmaker/skeleton'
13
+ require_relative 'punkmaker/zombie'
14
+ require_relative 'punkmaker/demon'
15
+ require_relative 'punkmaker/orc'
16
+ require_relative 'punkmaker/robot'
17
+ require_relative 'punkmaker/vampire'
18
+
9
19
 
10
20
  ## more hair (incl. beards & eyebrows)
11
21
  require_relative 'punkmaker/hair'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: punkmaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-27 00:00:00.000000000 Z
11
+ date: 2023-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pixelart
@@ -86,15 +86,39 @@ files:
86
86
  - Manifest.txt
87
87
  - README.md
88
88
  - Rakefile
89
+ - config/alien-female.png
90
+ - config/alien-male.png
91
+ - config/ape-female.png
92
+ - config/ape-male.png
93
+ - config/demon-female.png
94
+ - config/demon-male.png
89
95
  - config/human-female4.png
90
96
  - config/human-male4.png
91
97
  - config/mummy-female.png
92
98
  - config/mummy-male.png
99
+ - config/orc-female.png
100
+ - config/orc-male.png
101
+ - config/robot-female.png
102
+ - config/robot-male.png
103
+ - config/skeleton-female.png
104
+ - config/skeleton-male.png
105
+ - config/vampire-female.png
106
+ - config/vampire-male.png
107
+ - config/zombie-female.png
108
+ - config/zombie-male.png
93
109
  - lib/punkmaker.rb
110
+ - lib/punkmaker/alien.rb
111
+ - lib/punkmaker/ape.rb
112
+ - lib/punkmaker/demon.rb
94
113
  - lib/punkmaker/hair.rb
95
114
  - lib/punkmaker/human.rb
96
115
  - lib/punkmaker/mummy.rb
116
+ - lib/punkmaker/orc.rb
117
+ - lib/punkmaker/robot.rb
118
+ - lib/punkmaker/skeleton.rb
119
+ - lib/punkmaker/vampire.rb
97
120
  - lib/punkmaker/version.rb
121
+ - lib/punkmaker/zombie.rb
98
122
  homepage: https://github.com/cryptopunksnotdead/punkart.sandbox
99
123
  licenses:
100
124
  - Public Domain