punkmaker 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Manifest.txt +13 -10
- data/config/colors/eyes.csv +8 -0
- data/config/colors/hair.csv +16 -0
- data/lib/punkmaker/eyes.rb +12 -0
- data/lib/punkmaker/hair.rb +18 -33
- data/lib/punkmaker/skintone.rb +3 -3
- data/lib/punkmaker/{alien.rb → type/alien.rb} +12 -6
- data/lib/punkmaker/{human.rb → type/human.rb} +11 -7
- data/lib/punkmaker/version.rb +1 -1
- data/lib/punkmaker.rb +12 -10
- metadata +15 -12
- /data/lib/punkmaker/{ape.rb → type/ape.rb} +0 -0
- /data/lib/punkmaker/{demon.rb → type/demon.rb} +0 -0
- /data/lib/punkmaker/{mummy.rb → type/mummy.rb} +0 -0
- /data/lib/punkmaker/{orc.rb → type/orc.rb} +0 -0
- /data/lib/punkmaker/{robot.rb → type/robot.rb} +0 -0
- /data/lib/punkmaker/{skeleton.rb → type/skeleton.rb} +0 -0
- /data/lib/punkmaker/{vampire.rb → type/vampire.rb} +0 -0
- /data/lib/punkmaker/{zombie.rb → type/zombie.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e12bea3bca70b044ca008b68267c1ecb26defe4dd58874fab9910ea8c128af43
|
4
|
+
data.tar.gz: 75aa29674ac21933d85c085b08f14023c8e15a1274fca827220839a70ebfad3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e455114776d390c9948f6ba2226ee96974db4256f79c07d1a54076e4b8c521a0dc2619e5df404b415dd715ea2537d66bdd3b2aedd2ffd2abc6679f1d9750a54c
|
7
|
+
data.tar.gz: a365c4ef9273e33f806685e1dd3f92d2b41ec0aac22c244686922333335ef1efea7c13621a563994d6511859ffc3793270642e7b4cd9abc37a1f95410bc53be8
|
data/CHANGELOG.md
CHANGED
data/Manifest.txt
CHANGED
@@ -6,6 +6,8 @@ config/alien-female.png
|
|
6
6
|
config/alien-male.png
|
7
7
|
config/ape-female.png
|
8
8
|
config/ape-male.png
|
9
|
+
config/colors/eyes.csv
|
10
|
+
config/colors/hair.csv
|
9
11
|
config/demon-female.png
|
10
12
|
config/demon-male.png
|
11
13
|
config/human-female4.png
|
@@ -27,17 +29,18 @@ config/vampire-male.png
|
|
27
29
|
config/zombie-female.png
|
28
30
|
config/zombie-male.png
|
29
31
|
lib/punkmaker.rb
|
30
|
-
lib/punkmaker/alien.rb
|
31
|
-
lib/punkmaker/ape.rb
|
32
32
|
lib/punkmaker/colors.rb
|
33
|
-
lib/punkmaker/
|
33
|
+
lib/punkmaker/eyes.rb
|
34
34
|
lib/punkmaker/hair.rb
|
35
|
-
lib/punkmaker/human.rb
|
36
|
-
lib/punkmaker/mummy.rb
|
37
|
-
lib/punkmaker/orc.rb
|
38
|
-
lib/punkmaker/robot.rb
|
39
|
-
lib/punkmaker/skeleton.rb
|
40
35
|
lib/punkmaker/skintone.rb
|
41
|
-
lib/punkmaker/
|
36
|
+
lib/punkmaker/type/alien.rb
|
37
|
+
lib/punkmaker/type/ape.rb
|
38
|
+
lib/punkmaker/type/demon.rb
|
39
|
+
lib/punkmaker/type/human.rb
|
40
|
+
lib/punkmaker/type/mummy.rb
|
41
|
+
lib/punkmaker/type/orc.rb
|
42
|
+
lib/punkmaker/type/robot.rb
|
43
|
+
lib/punkmaker/type/skeleton.rb
|
44
|
+
lib/punkmaker/type/vampire.rb
|
45
|
+
lib/punkmaker/type/zombie.rb
|
42
46
|
lib/punkmaker/version.rb
|
43
|
-
lib/punkmaker/zombie.rb
|
@@ -0,0 +1,16 @@
|
|
1
|
+
color, names
|
2
|
+
|
3
|
+
0x000000, black
|
4
|
+
0x51360c, brown # (darker) brown
|
5
|
+
0xa66e2c, brunette # lighter brown
|
6
|
+
|
7
|
+
0xe65700, orange
|
8
|
+
0xe22626, red
|
9
|
+
0xff8ebe, pink
|
10
|
+
0x710cc7, purple
|
11
|
+
|
12
|
+
0x28b143, green
|
13
|
+
|
14
|
+
0xfff68e, blonde
|
15
|
+
0xe0e0e0, silver
|
16
|
+
0xffffff, white
|
data/lib/punkmaker/hair.rb
CHANGED
@@ -2,34 +2,15 @@
|
|
2
2
|
|
3
3
|
module Punk
|
4
4
|
module Hair
|
5
|
-
|
6
|
-
@colors ||=
|
7
|
-
{
|
8
|
-
'black' => '000000',
|
9
|
-
|
10
|
-
'brown' => '51360c', # (darker) brown
|
11
|
-
'brunette' => 'a66e2c', # lighter brown
|
12
|
-
|
13
|
-
'orange' => 'e65700',
|
14
|
-
'red' => 'e22626',
|
15
|
-
'pink' => 'ff8ebe',
|
16
|
-
'purple' => '710cc7',
|
17
|
-
|
18
|
-
'green' => '28b143',
|
19
|
-
|
20
|
-
'blonde' => 'fff68e',
|
21
|
-
'silver' => 'e0e0e0',
|
22
|
-
'white' => 'FFFFFF',
|
23
|
-
}.reduce( {} ) do |h, (name, color_hex)|
|
24
|
-
h[ name ] = Color.from_hex( color_hex )
|
25
|
-
h
|
26
|
-
end
|
27
|
-
end
|
28
|
-
@colors
|
5
|
+
def self.colors
|
6
|
+
@colors ||= ColorBundle.read( './config/colors/hair.csv' )
|
29
7
|
end
|
8
|
+
def self.[]( name ) colors.find_by( name: name ); end
|
9
|
+
|
10
|
+
|
30
11
|
|
31
12
|
def self.derive_color_map( color )
|
32
|
-
color = Color.
|
13
|
+
color = Color.from_hex( color ) if color.is_a?( String )
|
33
14
|
|
34
15
|
h,s,v = Color.to_hsv( color, include_alpha: false )
|
35
16
|
h = h % 360 ## make sure h(ue) is always positive!!!
|
@@ -98,6 +79,7 @@ module Punk
|
|
98
79
|
end
|
99
80
|
def find_by( name: ) @sheet.find_by( name: name ); end
|
100
81
|
|
82
|
+
|
101
83
|
def make( style, color: 'black' ) ## change name to colorize - why? why not?
|
102
84
|
## pass-through shavedhead (no colors - alpha only) - why? why not?
|
103
85
|
hair = @sheet.find_by( name: style )
|
@@ -106,16 +88,19 @@ module Punk
|
|
106
88
|
exit 1
|
107
89
|
end
|
108
90
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
puts "!! ERROR - unknow hair color >#{style}<; sorry"
|
113
|
-
exit 1
|
114
|
-
end
|
115
|
-
|
116
|
-
color_map = Hair.derive_color_map( rgba )
|
91
|
+
color = parse_hair_color( color )
|
92
|
+
|
93
|
+
color_map = Hair.derive_color_map( color )
|
117
94
|
hair.change_colors( color_map )
|
118
95
|
end
|
96
|
+
|
97
|
+
def parse_hair_color( color )
|
98
|
+
if color.is_a?( String )
|
99
|
+
@colors[ color ] || Color.from_hex( color )
|
100
|
+
else ## assume color is integer - assert - why? why not?
|
101
|
+
color
|
102
|
+
end
|
103
|
+
end
|
119
104
|
end ## (embedded) class Maker
|
120
105
|
end # module Hair
|
121
106
|
end # module Punk
|
data/lib/punkmaker/skintone.rb
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
module Punk
|
3
3
|
module Skintone
|
4
4
|
|
5
|
-
def self.
|
6
|
-
@
|
5
|
+
def self.colors
|
6
|
+
@colors ||= ColorBundle.read(
|
7
7
|
'./config/skintone/ye_olde_punks.csv',
|
8
8
|
'./config/skintone/color_me_human.csv',
|
9
9
|
'./config/skintone/dr_ellis_monk.csv',
|
10
10
|
'./config/skintone/punks_not_dead.csv' )
|
11
11
|
end
|
12
|
+
def self.[]( name ) colors.find_by( name: name ); end
|
12
13
|
|
13
|
-
def self.[]( name ) bundle.find_by( name: name ); end
|
14
14
|
end # module Skintone
|
15
15
|
end # module Punk
|
16
16
|
|
@@ -7,17 +7,23 @@ module Alien ## make it a class - why? why not?
|
|
7
7
|
BASE_M = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/alien-male.png" )
|
8
8
|
BASE_F = Image.read( "#{Pixelart::Module::Punkmaker.root}/config/alien-female.png" )
|
9
9
|
|
10
|
+
|
11
|
+
def self.base( gender: 'm' )
|
12
|
+
base = gender == 'm' ? BASE_M : BASE_F
|
13
|
+
|
14
|
+
## note: make a copy of base
|
15
|
+
punk = Image.new( base.width, base.height )
|
16
|
+
punk.compose!( base )
|
17
|
+
punk
|
18
|
+
end
|
19
|
+
|
10
20
|
|
11
21
|
def self.make( color=nil,
|
12
22
|
shine: true,
|
13
23
|
gender: 'm' )
|
14
24
|
|
15
|
-
base
|
16
|
-
|
17
|
-
## note: make a copy of base
|
18
|
-
punk = Image.new( base.width, base.height )
|
19
|
-
punk.compose!( base )
|
20
|
-
|
25
|
+
punk = base( gender: gender ) ## get base image (as a copy to modify)
|
26
|
+
|
21
27
|
if color ## change skin tone (& eyebrows)?
|
22
28
|
color_map = derive_color_map( color )
|
23
29
|
punk = punk.change_colors( color_map )
|
@@ -19,25 +19,29 @@ module Human ## make it a class - why? why not?
|
|
19
19
|
|
20
20
|
def self.parse_eye_color( color )
|
21
21
|
if color.is_a?( String )
|
22
|
-
Color.from_hex( color )
|
22
|
+
Eyes[ color ] || Color.from_hex( color )
|
23
23
|
else
|
24
24
|
color
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
|
29
|
+
def self.base( gender: 'm' )
|
30
|
+
base = gender == 'm' ? BASE_M : BASE_F
|
31
|
+
|
32
|
+
## note: make a copy of base
|
33
|
+
punk = Image.new( base.width, base.height )
|
34
|
+
punk.compose!( base )
|
35
|
+
punk
|
36
|
+
end
|
37
|
+
|
29
38
|
|
30
39
|
def self.make( color=nil,
|
31
40
|
shine: true,
|
32
41
|
eye_color: nil,
|
33
42
|
gender: 'm' )
|
34
43
|
|
35
|
-
base
|
36
|
-
|
37
|
-
## note: make a copy of base
|
38
|
-
punk = Image.new( base.width, base.height )
|
39
|
-
punk.compose!( base )
|
40
|
-
|
44
|
+
punk = base( gender: gender )
|
41
45
|
|
42
46
|
skintone = color ? parse_skintone( color ) : nil
|
43
47
|
if skintone ## change skin tone (& eyebrows)?
|
data/lib/punkmaker/version.rb
CHANGED
data/lib/punkmaker.rb
CHANGED
@@ -7,18 +7,20 @@ require_relative 'punkmaker/version' ## let version always go first
|
|
7
7
|
## support - move to ???
|
8
8
|
require_relative 'punkmaker/colors' ## ColorBundle (color by name lookup and mroe)
|
9
9
|
require_relative 'punkmaker/skintone'
|
10
|
+
require_relative 'punkmaker/eyes'
|
11
|
+
|
10
12
|
|
11
13
|
## more base / archetypes
|
12
|
-
require_relative 'punkmaker/human'
|
13
|
-
require_relative 'punkmaker/alien'
|
14
|
-
require_relative 'punkmaker/mummy'
|
15
|
-
require_relative 'punkmaker/ape'
|
16
|
-
require_relative 'punkmaker/skeleton'
|
17
|
-
require_relative 'punkmaker/zombie'
|
18
|
-
require_relative 'punkmaker/demon'
|
19
|
-
require_relative 'punkmaker/orc'
|
20
|
-
require_relative 'punkmaker/robot'
|
21
|
-
require_relative 'punkmaker/vampire'
|
14
|
+
require_relative 'punkmaker/type/human'
|
15
|
+
require_relative 'punkmaker/type/alien'
|
16
|
+
require_relative 'punkmaker/type/mummy'
|
17
|
+
require_relative 'punkmaker/type/ape'
|
18
|
+
require_relative 'punkmaker/type/skeleton'
|
19
|
+
require_relative 'punkmaker/type/zombie'
|
20
|
+
require_relative 'punkmaker/type/demon'
|
21
|
+
require_relative 'punkmaker/type/orc'
|
22
|
+
require_relative 'punkmaker/type/robot'
|
23
|
+
require_relative 'punkmaker/type/vampire'
|
22
24
|
|
23
25
|
|
24
26
|
## more hair (incl. beards & eyebrows)
|
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.3.
|
4
|
+
version: 0.3.3
|
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-09-
|
11
|
+
date: 2023-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pixelart
|
@@ -90,6 +90,8 @@ files:
|
|
90
90
|
- config/alien-male.png
|
91
91
|
- config/ape-female.png
|
92
92
|
- config/ape-male.png
|
93
|
+
- config/colors/eyes.csv
|
94
|
+
- config/colors/hair.csv
|
93
95
|
- config/demon-female.png
|
94
96
|
- config/demon-male.png
|
95
97
|
- config/human-female4.png
|
@@ -111,20 +113,21 @@ files:
|
|
111
113
|
- config/zombie-female.png
|
112
114
|
- config/zombie-male.png
|
113
115
|
- lib/punkmaker.rb
|
114
|
-
- lib/punkmaker/alien.rb
|
115
|
-
- lib/punkmaker/ape.rb
|
116
116
|
- lib/punkmaker/colors.rb
|
117
|
-
- lib/punkmaker/
|
117
|
+
- lib/punkmaker/eyes.rb
|
118
118
|
- lib/punkmaker/hair.rb
|
119
|
-
- lib/punkmaker/human.rb
|
120
|
-
- lib/punkmaker/mummy.rb
|
121
|
-
- lib/punkmaker/orc.rb
|
122
|
-
- lib/punkmaker/robot.rb
|
123
|
-
- lib/punkmaker/skeleton.rb
|
124
119
|
- lib/punkmaker/skintone.rb
|
125
|
-
- lib/punkmaker/
|
120
|
+
- lib/punkmaker/type/alien.rb
|
121
|
+
- lib/punkmaker/type/ape.rb
|
122
|
+
- lib/punkmaker/type/demon.rb
|
123
|
+
- lib/punkmaker/type/human.rb
|
124
|
+
- lib/punkmaker/type/mummy.rb
|
125
|
+
- lib/punkmaker/type/orc.rb
|
126
|
+
- lib/punkmaker/type/robot.rb
|
127
|
+
- lib/punkmaker/type/skeleton.rb
|
128
|
+
- lib/punkmaker/type/vampire.rb
|
129
|
+
- lib/punkmaker/type/zombie.rb
|
126
130
|
- lib/punkmaker/version.rb
|
127
|
-
- lib/punkmaker/zombie.rb
|
128
131
|
homepage: https://github.com/cryptopunksnotdead/punkart.sandbox
|
129
132
|
licenses:
|
130
133
|
- Public Domain
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|