gradient 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gradient/map.rb +4 -2
- data/lib/gradient/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c90b95d6eda4af13387ef56d48ee13c135ae97dd
|
4
|
+
data.tar.gz: ce7e64d799a4587190a79d3934f023aa4c8908c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8169e8ba9be408feb1007d7bbfc0f7627613f3632091df5635b1aa126036813c28c35a26d764c1304315579dbc45bd8c4e579a814b6bcac390498fa7b5642cbc
|
7
|
+
data.tar.gz: ebc81c832dc63be8435c7fad298e1f1ad41f467c762e25e86ae9be57686681f2dbb01024c8a34c9f1dde880a35b9124080aaee0ae0e058898b98961d04c4cfba
|
data/lib/gradient/map.rb
CHANGED
@@ -4,6 +4,8 @@ module Gradient
|
|
4
4
|
attr_reader :color_points, :opacity_points, :points
|
5
5
|
|
6
6
|
def initialize(color_points=[], opacity_points=[])
|
7
|
+
color_points << Gradient::ColorPoint.new(0, Color::RGB.new(255, 255, 255)) if color_points.empty?
|
8
|
+
opacity_points << Gradient::OpacityPoint.new(0, 1) if opacity_points.empty?
|
7
9
|
@color_points = sort_points(Array(color_points))
|
8
10
|
@opacity_points = sort_points(Array(opacity_points))
|
9
11
|
@all_points = sort_points(@color_points + @opacity_points)
|
@@ -44,8 +46,8 @@ module Gradient
|
|
44
46
|
|
45
47
|
private def previous_and_next_in(bucket, point)
|
46
48
|
groups = bucket.group_by { |p| point_group(p, point) }
|
47
|
-
a = groups.fetch(:same) { groups.fetch(:less) }.max { |p| p.location }
|
48
|
-
b = groups.fetch(:same) { groups.fetch(:more) }.min { |p| p.location }
|
49
|
+
a = groups.fetch(:same) { groups.fetch(:less) { groups.fetch(:more) } }.max { |p| p.location }
|
50
|
+
b = groups.fetch(:same) { groups.fetch(:more) { groups.fetch(:less) } }.min { |p| p.location }
|
49
51
|
return a, b
|
50
52
|
end
|
51
53
|
|
data/lib/gradient/version.rb
CHANGED