color-proximity 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/color-proximity.rb +1 -1
- data/lib/color-proximity/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a880f0e217f7a426eee1e5f712d2fac53ca25be8
|
4
|
+
data.tar.gz: 9e5edb656bc21e5fee2aad0ae0a81e8dd6fa0184
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2b0d95318e56e179a3896aab8c87987fe5c13aea1f952d2a5a2cbfaaa41f12f5bb1c2a5901e7910fabccf8adcadaca3f10c708aa8332dbfcdfbda711b08b2b6
|
7
|
+
data.tar.gz: 58aca5fe7dac92dba9f37b443a218deb6c48f87aa5d6694a54ed0cfeceb182ecf7c01d0e8f4a68e742216b2980d243f3b495634aee6ea01e4519a7e806dd7d0b
|
data/README.md
CHANGED
@@ -11,10 +11,10 @@ Given a threshold and a collection of colors, you'll be able to determine how cl
|
|
11
11
|
``` ruby
|
12
12
|
require 'color-proximity'
|
13
13
|
cp = ColorProximity.new(0.5, ['000000'])
|
14
|
-
cp.
|
14
|
+
cp.past_threshold?('000000') # [false, ['000000']]
|
15
15
|
|
16
16
|
cp.collection = ['ffffff'])
|
17
|
-
cp.
|
17
|
+
cp.past_threshold?('000000') # [true]
|
18
18
|
|
19
19
|
cp.collection = ['000001', '000002', 'ffffff'])
|
20
20
|
cp.thresholds('000003') # [3.3166247903554, 1.4142135623730951, 762.3437544835007]
|
data/lib/color-proximity.rb
CHANGED
@@ -10,7 +10,7 @@ class ColorProximity
|
|
10
10
|
@collection = collection
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def past_threshold?(color)
|
14
14
|
@collection.each_with_object([true]) do |collection_color, arr|
|
15
15
|
proximity = proximity_of(color, collection_color)
|
16
16
|
next unless @threshold > proximity
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: color-proximity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: color_difference
|