hairsalon 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f9526cba936f2604390345c586312900816b9d4146f6b58b18591e554a5205cd
4
+ data.tar.gz: 7dc48ac1a4daaf4e7fca4f87e6891383ceccf9d2d801479136453ecc85496830
5
+ SHA512:
6
+ metadata.gz: 467e8208d1f5a25889cd2243da98a0019cf5ee7f3b07f702bdc5fabca6da11f2671abd686b5ff819487a0a5a640d1680453689df7471dfed3e597044b12b8e3a
7
+ data.tar.gz: '00308148f092a25023e4a362d8ea1b735568e88e13b57a3d954df11040173adef9a8b79a1c6787c66a90e2f7c54e0c472bb6fa597f70569efed20862c3dfec68'
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ### 0.0.1 / 2023-08-27
2
+
3
+ * Everything is new. First release
data/Manifest.txt ADDED
@@ -0,0 +1,8 @@
1
+ CHANGELOG.md
2
+ Manifest.txt
3
+ README.md
4
+ Rakefile
5
+ config/spritesheet-hair.csv
6
+ config/spritesheet-hair.png
7
+ lib/hairsalon.rb
8
+ lib/hairsalon/version.rb
data/README.md ADDED
@@ -0,0 +1,138 @@
1
+ # hairsalon
2
+
3
+ hairsalon gem - make your own (pixel) punk hair style incl. mohawk, wild & crazy, short & long, and much more with your own hair colors incl white, silver, blonde, pink, purple, red and much more
4
+
5
+
6
+
7
+ * home :: [github.com/cryptopunksnotdead/punkart.sandbox](https://github.com/cryptopunksnotdead/punkart.sandbox)
8
+ * bugs :: [github.com/cryptopunksnotdead/punkart.sandbox/issues](https://github.com/cryptopunksnotdead/punkart.sandbox/issues)
9
+ * gem :: [rubygems.org/gems/hairsalon](https://rubygems.org/gems/hairsalon)
10
+ * rdoc :: [rubydoc.info/gems/hairsalon](http://rubydoc.info/gems/hairsalon)
11
+
12
+
13
+
14
+ ## Usage
15
+
16
+
17
+ ### Hair Colors
18
+
19
+ For now the hair colors include:
20
+
21
+ - ![](i/color-black.png) black - #000000 / rgb( 0 0 0) - hsl( 0° 0% 0%) - hsv( 0° 0% 0%)
22
+ - ![](i/color-brown.png) brown - #51360c / rgb( 81 54 12) - hsl( 37° 74% 18%) - hsv( 37° 85% 32%)
23
+ - ![](i/color-brunette.png) brunette - #a66e2c / rgb(166 110 44) - hsl( 32° 58% 41%) - hsv( 32° 73% 65%)
24
+ - ![](i/color-orange.png) orange - #e65700 / rgb(230 87 0) - hsl( 23° 100% 45%) - hsv( 23° 100% 90%)
25
+ - ![](i/color-red.png) red - #e22626 / rgb(226 38 38) - hsl( 0° 76% 52%) - hsv( 0° 83% 89%)
26
+ - ![](i/color-pink.png) pink - #ff8ebe / rgb(255 142 190) - hsl(335° 100% 78%) - hsv(335° 44% 100%)
27
+ - ![](i/color-purple.png) purple - #710cc7 / rgb(113 12 199) - hsl(272° 89% 41%) - hsv(272° 94% 78%)
28
+ - ![](i/color-green.png) green - #28b143 / rgb( 40 177 67) - hsl(132° 63% 43%) - hsv(132° 77% 69%)
29
+ - ![](i/color-blonde.png) blonde - #fff68e / rgb(255 246 142) - hsl( 55° 100% 78%) - hsv( 55° 44% 100%)
30
+ - ![](i/color-silver.png) silver - #e0e0e0 / rgb(224 224 224) - hsl( 0° 0% 88%) - hsv( 0° 0% 88%)
31
+ - ![](i/color-white.png) white - #ffffff / rgb(255 255 255) - hsl( 0° 0% 100%) - hsv( 0° 0% 100%)
32
+
33
+
34
+
35
+ ### Hair Styles
36
+
37
+ The hair styles include:
38
+
39
+ - afro ![](i/hair/afro-strip.png)
40
+ - big ![](i/hair/big-strip.png)
41
+ - bob ![](i/hair/bob-strip.png)
42
+ - bob2 ![](i/hair/bob2-strip.png)
43
+ - bob3 ![](i/hair/bob3-strip.png)
44
+ - buzzcut ![](i/hair/buzzcut-strip.png)
45
+ - clown ![](i/hair/clown-strip.png)
46
+ - clown2 ![](i/hair/clown2-strip.png)
47
+ - crazy ![](i/hair/crazy-strip.png)
48
+ - crazy2 ![](i/hair/crazy2-strip.png)
49
+ - crazy3 ![](i/hair/crazy3-strip.png)
50
+ - frumpy ![](i/hair/frumpy-strip.png)
51
+ - halfshaved ![](i/hair/halfshaved-strip.png)
52
+ - halfshaved2 ![](i/hair/halfshaved2-strip.png)
53
+ - halfshaved3 ![](i/hair/halfshaved3-strip.png)
54
+ - heart ![](i/hair/heart-strip.png)
55
+ - longcurly ![](i/hair/longcurly-strip.png)
56
+ - messy ![](i/hair/messy-strip.png)
57
+ - mohawk ![](i/hair/mohawk-strip.png)
58
+ - mohawk2 ![](i/hair/mohawk2-strip.png)
59
+ - mohawkthin ![](i/hair/mohawkthin-strip.png)
60
+ - peakspike ![](i/hair/peakspike-strip.png)
61
+ - peakspike2 ![](i/hair/peakspike2-strip.png)
62
+ - pigtails ![](i/hair/pigtails-strip.png)
63
+ - pigtails2 ![](i/hair/pigtails2-strip.png)
64
+ - pigtails3 ![](i/hair/pigtails3-strip.png)
65
+ - pixie ![](i/hair/pixie-strip.png)
66
+ - short ![](i/hair/short-strip.png)
67
+ - short2 ![](i/hair/short2-strip.png)
68
+ - side ![](i/hair/side-strip.png)
69
+ - side2 ![](i/hair/side2-strip.png)
70
+ - spiky ![](i/hair/spiky-strip.png)
71
+ - straight ![](i/hair/straight-strip.png)
72
+ - straight2 ![](i/hair/straight2-strip.png)
73
+ - straight3 ![](i/hair/straight3-strip.png)
74
+ - stringy ![](i/hair/stringy-strip.png)
75
+ - vampire ![](i/hair/vampire-strip.png)
76
+ - vampire2 ![](i/hair/vampire2-strip.png)
77
+ - wild ![](i/hair/wild-strip.png)
78
+ - wild2 ![](i/hair/wild2-strip.png)
79
+ - wild3 ![](i/hair/wild3-strip.png)
80
+ - wild4 ![](i/hair/wild4-strip.png)
81
+ - wild5 ![](i/hair/wild5-strip.png)
82
+
83
+
84
+ plus (no color - alpha channel only)
85
+
86
+ - shavedhead ![](i/hair/shavedhead.png)
87
+
88
+
89
+
90
+ ### How To Make Hair Styles
91
+
92
+
93
+ Use the make method - pass in the hair style and optional the color (default is black) -
94
+ and get the hair (pixel art) image attribute (in 24x24px).
95
+
96
+ ``` ruby
97
+ require 'hairsalon'
98
+
99
+ hair = Hairsalon::Hair.make( 'Buzz Cut' )
100
+ hair.save( "./buzzcut-black.png" )
101
+ hair.zoom(4).save( "./buzzcut-black@4x.png" )
102
+
103
+ hair = Hairsalon::Hair.make( 'Pigtails', color: 'Green' )
104
+ hair.save( "./pigtails-green.png" )
105
+ hair.zoom(4).save( "./pigtails-green@4x.png" )
106
+
107
+ hair = Hairsalon::Hair.make( 'Wild', color: 'Blonde' )
108
+ hair.save( "./wild-blonde.png" )
109
+ hair.zoom(4).save( "./wild-blonde@4x.png" )
110
+ ```
111
+
112
+
113
+ resulting in:
114
+
115
+ ![](i/buzzcut-black.png)
116
+ ![](i/pigtails-green.png)
117
+ ![](i/wild-blonde.png)
118
+
119
+ 4x
120
+
121
+ ![](i/buzzcut-black@4x.png)
122
+ ![](i/pigtails-green@4x.png)
123
+ ![](i/wild-blonde@4x.png)
124
+
125
+
126
+ That's it for now.
127
+
128
+
129
+
130
+
131
+ ## Questions? Comments?
132
+
133
+ Join us in the [Punk Art discord (chat server)](https://discord.gg/FE3HeXNKRa). Yes you can.
134
+ Your questions and commentary welcome.
135
+
136
+ Or post them over at the [Help & Support](https://github.com/geraldb/help) page. Thanks.
137
+
138
+
data/Rakefile ADDED
@@ -0,0 +1,39 @@
1
+ require 'hoe'
2
+ require './lib/hairsalon/version.rb'
3
+
4
+
5
+ ###
6
+ # hack/ quick fix for broken intuit_values - overwrite with dummy
7
+ # class Hoe
8
+ # def intuit_values( input ); end
9
+ # end
10
+
11
+
12
+ Hoe.spec 'hairsalon' do
13
+
14
+ self.version = Pixelart::Module::Hairsalon::VERSION
15
+
16
+ self.summary = 'hairsalon gem - make your own (pixel) punk hair style incl. mohawk, wild & crazy, short & long, and much more with your own hair colors incl white, silver, blonde, pink, purple, red and much more'
17
+ self.description = summary
18
+
19
+ self.urls = { home: 'https://github.com/cryptopunksnotdead/punkart.sandbox' }
20
+
21
+ self.author = 'Gerald Bauer'
22
+ self.email = 'gerald.bauer@gmail.com'
23
+
24
+ # switch extension to .markdown for gihub formatting
25
+ self.readme_file = 'README.md'
26
+ self.history_file = 'CHANGELOG.md'
27
+
28
+ self.extra_deps = [
29
+ ['punkmaker'],
30
+ ]
31
+
32
+ self.licenses = ['Public Domain']
33
+
34
+ self.spec_extras = {
35
+ required_ruby_version: '>= 2.3'
36
+ }
37
+
38
+ end
39
+
@@ -0,0 +1,45 @@
1
+ id, category, name, more_names
2
+ 0, , afro,
3
+ 1, , big,
4
+ 2, , bob,
5
+ 3, , bob2,
6
+ 4, , bob3,
7
+ 5, , buzzcut,
8
+ 6, , clown,
9
+ 7, , clown2,
10
+ 8, , crazy,
11
+ 9, , crazy2,
12
+ 10, , crazy3,
13
+ 11, , frumpy,
14
+ 12, , halfshaved,
15
+ 13, , halfshaved2,
16
+ 14, , halfshaved3,
17
+ 15, , heart,
18
+ 16, , longcurly,
19
+ 17, , messy,
20
+ 18, , mohawk,
21
+ 19, , mohawk2,
22
+ 20, , mohawkthin,
23
+ 21, , peakspike,
24
+ 22, , peakspike2,
25
+ 23, , pigtails,
26
+ 24, , pigtails2,
27
+ 25, , pigtails3,
28
+ 26, , pixie,
29
+ 27, , shavedhead,
30
+ 28, , short,
31
+ 29, , short2,
32
+ 30, , side,
33
+ 31, , side2,
34
+ 32, , spiky,
35
+ 33, , straight,
36
+ 34, , straight2,
37
+ 35, , straight3,
38
+ 36, , stringy,
39
+ 37, , vampire,
40
+ 38, , vampire2,
41
+ 39, , wild,
42
+ 40, , wild2,
43
+ 41, , wild3,
44
+ 42, , wild4,
45
+ 43, , wild5,
Binary file
@@ -0,0 +1,24 @@
1
+ module Pixelart
2
+ module Module
3
+ module Hairsalon
4
+ MAJOR = 0
5
+ MINOR = 0
6
+ PATCH = 1
7
+ VERSION = [MAJOR,MINOR,PATCH].join('.')
8
+
9
+ def self.version
10
+ VERSION
11
+ end
12
+
13
+ def self.banner
14
+ "hairsalon/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
15
+ end
16
+
17
+ def self.root
18
+ File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
19
+ end
20
+
21
+ end # module Hairsalon
22
+ end # module Module
23
+ end # module Pixelart
24
+
data/lib/hairsalon.rb ADDED
@@ -0,0 +1,37 @@
1
+ require 'punkmaker'
2
+
3
+
4
+ # our code
5
+ require_relative 'hairsalon/version' # let version go first
6
+
7
+
8
+
9
+ module Hairsalon
10
+ module Hair
11
+ def self.maker
12
+ @maker ||= Punk::Hair::Maker.read( "#{Pixelart::Module::Hairsalon.root}/config/spritesheet-hair.png",
13
+ "#{Pixelart::Module::Hairsalon.root}/config/spritesheet-hair.csv",
14
+ width: 24, height: 24,
15
+ colors: Punk::Hair.colors )
16
+ end
17
+ def self.sheet() maker.sheet; end
18
+ def self.colors() maker.colors; end
19
+
20
+ def self.make( style, color: 'black' )
21
+ maker.make( style, color: color )
22
+ end
23
+
24
+ ## "low-level" convenience helper/wrapper/forwarder
25
+ def self.colorize( hair, color: ) Punk::Hair.colorize( hair, color: color ); end
26
+ end # module Hair
27
+ end # module Hairsalon
28
+
29
+
30
+
31
+ ## add aliases - why? why not?
32
+ Salon = Hairsalon
33
+ HairSalon = Hairsalon
34
+
35
+
36
+
37
+ puts Pixelart::Module::Hairsalon.banner ## say hello
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hairsalon
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Gerald Bauer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-08-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: punkmaker
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '4.0'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '7'
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '4.0'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '7'
47
+ - !ruby/object:Gem::Dependency
48
+ name: hoe
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '4.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '4.0'
61
+ description: hairsalon gem - make your own (pixel) punk hair style incl. mohawk, wild
62
+ & crazy, short & long, and much more with your own hair colors incl white, silver,
63
+ blonde, pink, purple, red and much more
64
+ email: gerald.bauer@gmail.com
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files:
68
+ - CHANGELOG.md
69
+ - Manifest.txt
70
+ - README.md
71
+ files:
72
+ - CHANGELOG.md
73
+ - Manifest.txt
74
+ - README.md
75
+ - Rakefile
76
+ - config/spritesheet-hair.csv
77
+ - config/spritesheet-hair.png
78
+ - lib/hairsalon.rb
79
+ - lib/hairsalon/version.rb
80
+ homepage: https://github.com/cryptopunksnotdead/punkart.sandbox
81
+ licenses:
82
+ - Public Domain
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options:
86
+ - "--main"
87
+ - README.md
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '2.3'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubygems_version: 3.4.10
102
+ signing_key:
103
+ specification_version: 4
104
+ summary: hairsalon gem - make your own (pixel) punk hair style incl. mohawk, wild
105
+ & crazy, short & long, and much more with your own hair colors incl white, silver,
106
+ blonde, pink, purple, red and much more
107
+ test_files: []