falu 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 +4 -4
- data/lib/falu/image.rb +4 -4
- data/lib/falu/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: a596b1571462637d99273b711c2489641d3f1409
|
4
|
+
data.tar.gz: 91424364b332d0ea3b345bf53c9406ef65c2db0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed9b2293b5f5efb04d6d65597f47ea15773011138d4705dd056879c6e367fd7966ab531e996c22d3318fea9d2e5a349811ae4f2c60a78b178d935debf3304297
|
7
|
+
data.tar.gz: f3642a9ec4e03309a3ab1ea6e15216f3d09b7128d932c1d61deef1a7c399145480143d2ae2ea28ac3fca56aed7e2f5a8809f80e970632d0f63e9c64e8ee35aea
|
data/lib/falu/image.rb
CHANGED
@@ -80,10 +80,10 @@ module Falu
|
|
80
80
|
|
81
81
|
def sample(x=0, y=0, w=nil, h=nil, size: 10, sample: false, &block)
|
82
82
|
palette = {}
|
83
|
-
pixels(x, y, w, h, size: size, sample: sample) do |x,y,
|
84
|
-
palette[
|
85
|
-
palette[
|
86
|
-
yield(
|
83
|
+
pixels(x, y, w, h, size: size, sample: sample) do |x,y,rgb,hex|
|
84
|
+
palette[hex] ||= 0
|
85
|
+
palette[hex] += 1
|
86
|
+
yield(hex) if block_given?
|
87
87
|
end
|
88
88
|
palette.to_a.to_enum
|
89
89
|
end
|
data/lib/falu/version.rb
CHANGED