stitchify 0.2.7 → 0.2.9

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
  SHA1:
3
- metadata.gz: 075c84e80386052b68c7a4ef0b4a413cca2293d6
4
- data.tar.gz: 96ef61fa87cb55429646df1158d5581ea94e5602
3
+ metadata.gz: 8f228dfe33b05f3834ac9715b63ee94a9206bb8c
4
+ data.tar.gz: 0fff2007abda2ee1aeb2a2c0f2419de182caad78
5
5
  SHA512:
6
- metadata.gz: 7e21003a1cbec702b06388b5546a98793f51f0dc7805077edb44a10b31af168495087cab66ab5ca6316fef560782bc6cbb3d5cf572c3eab1a8bec224c4783a96
7
- data.tar.gz: 6fb7d976aa22e136cdc200de28d6a8fecccc5c6adf36ea21a0d6e6e86e7982808c18e80b9970697e048ece0bc541c40d0bde521eaec500c5eac48be06d927db3
6
+ metadata.gz: 8098552cb9b9ae86ae3e12aa9128ba3d38f813631bb908cbd2ea1683e4de13d57eebec3dd071340e42b97acd1e77c1d28bd990496ff3fdddb378ecaa2b82dad5
7
+ data.tar.gz: 2c9b22acaeca88525af07345fa776b886eade84e99a4abb343114e8540d87ef3dd8a54ea403a175a3dc3be76dee0d4e9169c0fee30fbcb6d8f3745fdeaf8a6c2
@@ -110,7 +110,7 @@ class Stitchifier
110
110
  end
111
111
 
112
112
  def black_and_white
113
- [Pixelfy.new(0, 0, 0, 'circle'), Pixelfy.new(0, 0, 100, 'x')]
113
+ [Pixelfy.new(0, 0, 0, 'x'), Pixelfy.new(0, 0, 100, 'circle')]
114
114
  end
115
115
 
116
116
  def build_pixel_array
@@ -51,21 +51,12 @@ class Pixelfy
51
51
  closest_px = map[0]
52
52
 
53
53
  map.each do |dom_px|
54
- hue_delta = (dom_px.hue - self.hue).abs
55
-
56
- if hue_delta < deltae
57
-
58
- deltae = hue_delta
59
- closest_px = dom_px
60
-
61
- elsif hue_delta == deltae
62
- dom_px_delta = self.get_full_delta(dom_px)
63
- current_px_delta = self.get_full_delta(closest_px)
64
- if dom_px_delta < current_px_delta
65
- deltae = hue_delta
66
- closest_px = dom_px
67
- end
68
- end
54
+ dom_px_delta = self.get_delta_e(dom_px)
55
+ current_px_delta = self.get_delta_e(closest_px)
56
+ if dom_px_delta < current_px_delta
57
+ deltae = dom_px_delta
58
+ closest_px = dom_px
59
+ end
69
60
  end
70
61
 
71
62
  self.hue = closest_px.hue
@@ -76,7 +67,7 @@ class Pixelfy
76
67
  self
77
68
  end
78
69
 
79
- def get_full_delta(px)
70
+ def get_delta_e(px)
80
71
  hue_delta = (px.hue - self.hue).abs
81
72
  sat_delta = (px.saturation - self.saturation).abs
82
73
  lit_delta = (px.lightness - self.lightness).abs
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stitchify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ellen Wondra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-23 00:00:00.000000000 Z
11
+ date: 2020-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rasem
@@ -108,8 +108,8 @@ dependencies:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
110
  version: 0.11.3
111
- description: ultimate goal is to input an HTML document and output an SVG cross stitching
112
- pattern
111
+ description: takes a .jpg image and converts it to an SVG cross stitching pattern.
112
+ You can change the colors, the width, and the number of colors used.
113
113
  email: ellenfromillinois@gmail.com
114
114
  executables: []
115
115
  extensions: []