cryptopunks-gui 0.0.1 → 0.0.2

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: 638f51a380dd6b45383886ed659fc66f4c1c1146cc077f6ac0730df1091a0f76
4
- data.tar.gz: faebbbfbe3b248634efb2778c7d489263eea2eebc199537cd1fc6d952fac8a04
3
+ metadata.gz: 3c2dbdaae667d1a222c8d3484dce2903b6a7636fe8445287124c3fa9293f6ab3
4
+ data.tar.gz: d4066e8e07533ac59630f345cbd7496abffdbbcccee541100716e582bd0a5f03
5
5
  SHA512:
6
- metadata.gz: 41603636b0e506f8c2d2fc72a94503238c2175b83ef09646bfbcfd1fb3b30af281cbe868521e0c76282758b9b0f2c5fd9592305d334411cbb626f42aa48d925a
7
- data.tar.gz: 34b378495780b241c5a123da56e249c775286e6f5aed81a300b7f07b860fa2beb1dccb3964efad2b1e91294af28b671d45bbd24841fadd95df95d05dbbae1b87
6
+ metadata.gz: 47b5b1513fb6328af05d4adf9bdff57598596b747f3257c05d3fc7f6969cb06e02bf7d311442d71d890535e777e545765a66802773d898ed72bd39beedc1a6d7
7
+ data.tar.gz: 6c61ff9deeb391131f9a94da5c217afe6a228763aa7427bac374a99dde1d3af8cf84794166faa5206dad9325a9b274ef54546bedd9b9b89094c5dee6408e236c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.2
4
+
5
+ - Palette support (e.g. grayscale or sepia)
6
+
3
7
  ## 0.0.1
4
8
 
5
9
  - Initial CryptoPunks GUI with support for punk index and zoom
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.1
1
+ # <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.2
2
2
  ## Simplified Minting
3
3
  [![Gem Version](https://badge.fury.io/rb/cryptopunks-gui.svg)](http://badge.fury.io/rb/cryptopunks-gui)
4
4
 
@@ -25,7 +25,7 @@ You can use CryptoPunks GUI via gem or via cloning repository.
25
25
  Run:
26
26
 
27
27
  ```
28
- gem install cryptopunks-gui -v0.0.1
28
+ gem install cryptopunks-gui -v0.0.2
29
29
  ```
30
30
 
31
31
  Afterwards, run app via:
@@ -67,6 +67,26 @@ Alternatively, run app manually via:
67
67
  ruby app/cryptopunks_gui.rb
68
68
  ```
69
69
 
70
+ ## Instructions
71
+
72
+ ### Punk Index
73
+
74
+ Change punk index to pick a different punk.
75
+
76
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-different-punk-index.png)
77
+
78
+ ### Zoom
79
+
80
+ Change zoom to enlarge punk to your liking.
81
+
82
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-different-zoom.png)
83
+
84
+ ### Palette
85
+
86
+ Change palette to get different punk colors.
87
+
88
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-different-palette.png)
89
+
70
90
  ## TODO
71
91
 
72
92
  [TODO.md](TODO.md)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -9,7 +9,9 @@ require 'puts_debuggerer'
9
9
  class CryptopunksGui
10
10
  include Glimmer
11
11
 
12
- attr_accessor :punk_index, :zoom
12
+ PALETTES = ['Standard'] + (Palette8bit.constants).map(&:name).map {|palette| palette.split('_').map(&:capitalize).join(' ')}.reject { |palette| palette.include?(' ') }
13
+
14
+ attr_accessor :punk_index, :zoom, :palette
13
15
 
14
16
  def initialize
15
17
  @punk_directory = File.join(Dir.home, '.cryptopunks')
@@ -18,22 +20,29 @@ class CryptopunksGui
18
20
  File.write(@punk_file, Net::HTTP.get(URI('https://raw.githubusercontent.com/larvalabs/cryptopunks/master/punks.png'))) unless File.exist?(@punk_file)
19
21
  @punks = Punks::Image::Composite.read(@punk_file)
20
22
  @zoom = 12
23
+ @palette = 'Standard'
21
24
 
22
25
  observer = Glimmer::DataBinding::Observer.proc do
23
26
  generate_image
24
27
  end
25
28
  observer.observe(self, :punk_index)
26
29
  observer.observe(self, :zoom)
30
+ observer.observe(self, :palette)
27
31
 
28
32
  create_gui
29
33
  self.punk_index = 0
30
34
  @root.open
31
35
  end
32
36
 
37
+ def palette_options
38
+ PALETTES
39
+ end
40
+
33
41
  def generate_image
34
- image_location = File.join(@punk_directory, "punk-#{@punk_index}#{"x#{@zoom}" if @zoom.to_i > 1}.png")
42
+ image_location = File.join(@punk_directory, "punk-#{@punk_index}#{"x#{@zoom}" if @zoom.to_i > 1}#{"-#{@palette.downcase.gsub(' ', '_')}" if @palette != 'Standard'}.png")
35
43
  puts "Writing punk image to #{image_location}"
36
44
  selected_punk = @punks[@punk_index.to_i]
45
+ selected_punk = selected_punk.change_palette8bit(Palette8bit.const_get(@palette.gsub(' ', '_').upcase.to_sym)) if @palette != 'Standard'
37
46
  selected_punk = selected_punk.zoom(@zoom.to_i)
38
47
  selected_punk.save(image_location)
39
48
  @image_label.image = image_location
@@ -69,6 +78,15 @@ class CryptopunksGui
69
78
  text <=> [self, :zoom]
70
79
  }
71
80
 
81
+ label {
82
+ text 'Palette:'
83
+ }
84
+ combobox {
85
+ # TODO (mirrored, grayscale, sepia, etc...)
86
+ readonly true # this applies to text editing only (item selection still triggers a write to model)
87
+ text <=> [self, :palette]
88
+ }
89
+
72
90
  label {
73
91
  text 'Output Location:'
74
92
  }
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: cryptopunks-gui 0.0.1 ruby app
5
+ # stub: cryptopunks-gui 0.0.2 ruby app
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "cryptopunks-gui".freeze
9
- s.version = "0.0.1"
9
+ s.version = "0.0.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["app".freeze]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptopunks-gui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh