colorscore 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of colorscore might be problematic. Click here for more details.
- data/lib/colorscore/metrics.rb +4 -10
- data/lib/colorscore/version.rb +1 -1
- metadata +9 -7
data/lib/colorscore/metrics.rb
CHANGED
@@ -29,17 +29,11 @@ module Colorscore
|
|
29
29
|
c2p = Math.sqrt((a2p ** 2) + (b2 ** 2))
|
30
30
|
avg_c1p_c2p = (c1p + c2p) / 2.0
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
else
|
35
|
-
h1p = degrees(Math.atan2(b1,a1p)) + 360
|
36
|
-
end
|
32
|
+
h1p = ([b1, a1p] == [0.0, 0.0]) ? 0.0 : degrees(Math.atan2(b1,a1p))
|
33
|
+
h1p += 360 if h1p < 0
|
37
34
|
|
38
|
-
|
39
|
-
|
40
|
-
else
|
41
|
-
h2p = degrees(Math.atan2(b2,a2p)) + 360
|
42
|
-
end
|
35
|
+
h2p = ([b2, a2p] == [0.0, 0.0]) ? 0.0 : degrees(Math.atan2(b2,a2p))
|
36
|
+
h2p += 360 if h2p < 0
|
43
37
|
|
44
38
|
if (h1p - h2p).abs > 180
|
45
39
|
avg_hp = (h1p + h2p + 360) / 2.0
|
data/lib/colorscore/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colorscore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Milo Winningham
|
@@ -15,10 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-01-12 00:00:00 -08:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
|
-
name: color
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
@@ -30,9 +30,9 @@ dependencies:
|
|
30
30
|
- 0
|
31
31
|
version: "0"
|
32
32
|
type: :runtime
|
33
|
+
name: color
|
33
34
|
version_requirements: *id001
|
34
35
|
- !ruby/object:Gem::Dependency
|
35
|
-
name: rake
|
36
36
|
prerelease: false
|
37
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
38
38
|
none: false
|
@@ -44,6 +44,7 @@ dependencies:
|
|
44
44
|
- 0
|
45
45
|
version: "0"
|
46
46
|
type: :development
|
47
|
+
name: rake
|
47
48
|
version_requirements: *id002
|
48
49
|
description: Finds the dominant colors in an image and scores them against a user-defined palette, using the CIE2000 Delta E formula.
|
49
50
|
email:
|
@@ -69,6 +70,7 @@ files:
|
|
69
70
|
- test/metrics_test.rb
|
70
71
|
- test/palette_test.rb
|
71
72
|
- test/test_helper.rb
|
73
|
+
has_rdoc: true
|
72
74
|
homepage:
|
73
75
|
licenses: []
|
74
76
|
|
@@ -98,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
100
|
requirements: []
|
99
101
|
|
100
102
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.
|
103
|
+
rubygems_version: 1.6.2
|
102
104
|
signing_key:
|
103
105
|
specification_version: 3
|
104
106
|
summary: Finds the dominant colors in an image.
|