rainbow_gradient 0.0.5 → 0.0.6

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: a750246160154048080afa7ddf2bb403f372b49c
4
- data.tar.gz: d1e33710d8d3f14cd300ff64c56fb12667b6f3ac
3
+ metadata.gz: cb79c41b47fd5c4ef9c145bcf5fca9c22b7542f9
4
+ data.tar.gz: 18be4286ebceea937cbdfca2f9b336cbcde0adb0
5
5
  SHA512:
6
- metadata.gz: f410c6186c83061376c0d83e25861dc9edf01a45db42be8a7623160074fa532f2a8d0e579e851d9acb3dcf1bfdfc11c185bedac0dfa34f1484ed73d7c7eb1666
7
- data.tar.gz: ec1a3ad2a431165bae56123e740743905e9256ba882c4c8b267d1f27e0d30cb23d6c29a5748dbc1185aeb854e37270ce98e341872835154118b4d3914436cac2
6
+ metadata.gz: 7df48a93150dcd667c8dfbbc89fbc4ac8f310928477b9feda1da2fb0c9db786ebc3b430beecea02f2b16386e59e26a9b60d5cf6f97bbeb494136f2387ffb87b1
7
+ data.tar.gz: 4f026e45176d9845f664ca63a6610b7e0a11a77a2c12c9a8c92cb9ca6648e5c97c643798b5c84b79f8abeeb04b0ab2cf48a25cf0ee58c54048bd2491cf52e6bd
@@ -68,6 +68,13 @@ module Rainbow
68
68
  @mid_location_in_pixel = @from_location_in_pixel + @first_width
69
69
  @to_location_in_pixel = @from_location_in_pixel + @width
70
70
 
71
+ if ENV['CHOPSTICK_DEBUG']
72
+ puts "from: (#{from_color.location * gradient.width / 100.0}) #{@from_location_in_pixel}, " +
73
+ "to: #{@to_location_in_pixel}, " +
74
+ "width: (#{gradient.width * (to_color.location - from_color.location) / 100.0}) #{@width}"
75
+ puts '-' * 50
76
+ end
77
+
71
78
  @leftover_width = ((100 - to_color.location) * gradient.width / 100.0).ceil
72
79
  end
73
80
 
@@ -169,8 +169,14 @@ module Rainbow
169
169
  end
170
170
 
171
171
  def paint_body(canvas, color_range, x_coverred)
172
+ n = 0
172
173
  color_range.width.times do |x|
173
- x += x_coverred
174
+ if x == 0 && x + x_coverred != color_range.from_location_in_pixel
175
+ n = x + x_coverred - color_range.from_location_in_pixel
176
+ end
177
+
178
+ x += x_coverred - n
179
+ puts " x: #{x}, n: #{n}" if ENV['RAINBOW_DEBUG']
174
180
 
175
181
  break if x == width
176
182
 
@@ -184,6 +190,9 @@ module Rainbow
184
190
  def paint_suffix(canvas, color_range, x_coverred)
185
191
  color_range.leftover_width.times do |x|
186
192
  x += x_coverred
193
+
194
+ break if x == width
195
+
187
196
  color_range.current_x = x
188
197
  height.times { |y| canvas[x, y] = color_range.current_color }
189
198
  end
@@ -1,3 +1,3 @@
1
1
  module Rainbow
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rainbow_gradient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sophy Eung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-01 00:00:00.000000000 Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chunky_png