colorname 0.1.2 → 0.1.3

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: c65562e11219849f7464cd32a0f6e94b016b12ec
4
- data.tar.gz: bf22917f61d895f4ac42fe18375e2ffe18c63fbb
3
+ metadata.gz: 5a94e2bf0ab6680f212138431ecd182d514ff0d2
4
+ data.tar.gz: cc59c1e8055805d94c2d242be18c91b7dbc999a6
5
5
  SHA512:
6
- metadata.gz: aef8509f8235dc9eec72f3b9be349cb817a50a70ac08ffc4554d122d84dd7a246254a8eaaf78ee45d0fab726b4478c859e735ac8ce5c2075c9242ee21aad6f60
7
- data.tar.gz: 785559f562ccd0cef2de79ae6175604eaae2b131724139e065f120e2820ebb399def2d46df1cfd2a4183fccd9bc6f5d00cae13955a81ac1a30e8f9c753dd46d7
6
+ metadata.gz: fbdf09b61a9d27dd3b50380c56f8d22f6acf043cd6a2b25a675402b30076dd120e572b5d6eede3294e672a537f3df6e8ff6abcd5ca45777c3ea7c80253373109
7
+ data.tar.gz: 888ea45762fdf41d46de19ac7387e020d1957b3ae0bb74c25a71a1b5633d1bc40b031dfe8859cc69361eb0e272413ec5c6db0798baf2ba6b2ab8dbed3fabe205
data/README.md CHANGED
@@ -35,6 +35,16 @@ Colorname.find 143, 188, 143 # [:darkseagreen]
35
35
  Colorname.find Color::RGB.new(255, 0, 255) # [:fuchsia, :magenta]
36
36
  ```
37
37
 
38
+ To find names of most dominant colors of and image
39
+
40
+ ```ruby
41
+ Colorname.find_by_image (url_or_path) # [:names_of_most_dominant_colors]
42
+
43
+ Colorname.findbyimage (url_or_path) # [:names_of_most_dominant_colors]
44
+
45
+ ```
46
+
47
+
38
48
  To find dominant base color name
39
49
 
40
50
  ```ruby
Binary file
@@ -6,10 +6,10 @@ require 'colorname/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'colorname'
8
8
  spec.version = Colorname::VERSION
9
- spec.authors = ['celilileri','ozeno']
9
+ spec.authors = ['Serhat Celil İLERİ', 'Ömer ÖZEN']
10
10
  spec.email = ['celil.ileri@bil.omu.edu.tr']
11
11
 
12
- spec.summary = 'A Color Categorizator and Namer Ruby Gem'
12
+ spec.summary = 'Find color name and categorize easily by a Ruby Gem!'
13
13
  spec.homepage = 'https://github.com/celilileri/colorname'
14
14
  spec.license = 'MIT'
15
15
 
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ['lib']
23
23
 
24
24
  spec.add_dependency 'color', '~> 1.8'
25
+ spec.add_dependency 'miro', '~> 0.4.0'
25
26
 
26
27
  spec.add_development_dependency 'bundler', '~> 1.14'
27
28
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -3,8 +3,19 @@ require 'colorname/version'
3
3
  require 'colorname/pre'
4
4
  require 'colorname/base'
5
5
  require 'colorname/find'
6
+ require 'colorname/find_by_image'
6
7
  require 'colorname/list'
8
+ require 'miro'
7
9
 
10
+ ##
8
11
  # Colorname Module
12
+ #
13
+ # This module helps you to find the closest named color's name.
14
+ #
15
+ # The closest color is finding by calculating percent error formula between
16
+ # your given color and named color list's every element's Red, Green and Blue
17
+ # values.
18
+ # Logically:
19
+ # many named colors = better pair
9
20
  module Colorname
10
21
  end
@@ -2,6 +2,10 @@
2
2
  module Colorname
3
3
  class << self
4
4
  def base(*cc)
5
+ # Base Color Finder
6
+ #
7
+ # This function helps you to find the most dominant base color name
8
+ # of the given color.
5
9
  base_color make_color *cc
6
10
  end
7
11
 
@@ -2,6 +2,10 @@
2
2
  module Colorname
3
3
  class << self
4
4
  def find(*cc)
5
+ # find (color_code or Color instance)
6
+ #
7
+ # This function helps you to find the name of the closest color's name
8
+ # to given color or color code.
5
9
  decide make_color *cc
6
10
  end
7
11
 
@@ -0,0 +1,22 @@
1
+ # Find dominant colors in an image
2
+ module Colorname
3
+ class << self
4
+ def find_by_image(image)
5
+ # find_by_image ( image path or url )
6
+ #
7
+ # This function help you to find the most dominant colors' names in
8
+ # given image.
9
+ #
10
+ # You can give a path or url as arguement.
11
+ colors = Miro::DominantColors.new(image)
12
+ color_names = []
13
+
14
+ colors.to_rgb.each do |color|
15
+ color_names << find(*color)
16
+ end
17
+
18
+ color_names
19
+ end
20
+ alias findbyimage find_by_image
21
+ end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module Colorname
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colorname
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
- - celilileri
8
- - ozeno
7
+ - Serhat Celil İLERİ
8
+ - Ömer ÖZEN
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-05-06 00:00:00.000000000 Z
12
+ date: 2017-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: color
@@ -25,6 +25,20 @@ dependencies:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.8'
28
+ - !ruby/object:Gem::Dependency
29
+ name: miro
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: 0.4.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 0.4.0
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: bundler
30
44
  requirement: !ruby/object:Gem::Requirement
@@ -85,11 +99,12 @@ files:
85
99
  - Rakefile
86
100
  - bin/console
87
101
  - bin/setup
88
- - colorname-0.1.0.gem
102
+ - colorname-0.1.2.5.gem
89
103
  - colorname.gemspec
90
104
  - lib/colorname.rb
91
105
  - lib/colorname/base.rb
92
106
  - lib/colorname/find.rb
107
+ - lib/colorname/find_by_image.rb
93
108
  - lib/colorname/list.rb
94
109
  - lib/colorname/pre.rb
95
110
  - lib/colorname/version.rb
@@ -116,5 +131,5 @@ rubyforge_project:
116
131
  rubygems_version: 2.6.8
117
132
  signing_key:
118
133
  specification_version: 4
119
- summary: A Color Categorizator and Namer Ruby Gem
134
+ summary: Find color name and categorize easily by a Ruby Gem!
120
135
  test_files: []
Binary file