rgb_utils 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/rgb_utils/attributes/color.rb +15 -0
- data/lib/rgb_utils/calculator.rb +11 -0
- data/lib/rgb_utils/calculators/luma_calculator.rb +21 -0
- data/lib/rgb_utils/calculators/relative_luminance_calculator.rb +21 -0
- data/lib/rgb_utils/config.rb +10 -0
- data/lib/rgb_utils/converter.rb +11 -0
- data/lib/rgb_utils/converters/hex_to_rgb_converter.rb +31 -0
- data/lib/rgb_utils/converters/rgb_to_hex_converter.rb +25 -0
- data/lib/rgb_utils/converters/rgb_to_linear_rgb_converter.rb +33 -0
- data/lib/rgb_utils/converters/web_safe_to_hex_converter.rb +34 -0
- data/lib/rgb_utils/models/linear_rgb.rb +9 -0
- data/lib/rgb_utils/models/rgb.rb +23 -0
- data/lib/rgb_utils/resolver.rb +11 -0
- data/lib/rgb_utils/resolvers/complex_contrast_color_resolver.rb +29 -0
- data/lib/rgb_utils/resolvers/simple_contrast_color_resolver.rb +27 -0
- data/lib/rgb_utils/version.rb +3 -0
- data/lib/rgb_utils.rb +18 -0
- data/rgb_utils.gemspec +38 -0
- metadata +144 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 69a46dc13601a88ee4cb0202ed9da3b43a48aebc
|
4
|
+
data.tar.gz: 189bf69cd77c12e5945ae9f88cca072ee499bb70
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0e6d63fd0719d42e5c2d352337e5fdcefb09a88916732f392674df83486d9dd90f9d6bd49aaef83d968c02397b78700d1152b68aea3c51aa3f8955fbd9d583ce
|
7
|
+
data.tar.gz: 22a614e815b69deda80c9aed3295824311ba9d6abe8b421517cfd4b265edbe32f95101627ca670a90b64d35b13d01a7792368ef479b1b3d9bbe2951fd73c4a51
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at andrerpbts@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 andrerpbts
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# RGB Utils
|
2
|
+
|
3
|
+
A set of RGB functions.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'rgb_utils'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install rgb_utils
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Development
|
26
|
+
|
27
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
28
|
+
|
29
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
30
|
+
|
31
|
+
## Contributing
|
32
|
+
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/andrerpbts/rgb_utils. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
34
|
+
|
35
|
+
|
36
|
+
## License
|
37
|
+
|
38
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
39
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'rgb_utils'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require 'pry'
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module RGBUtils
|
2
|
+
class LumaCalculator < Calculator
|
3
|
+
RED_L = 0.299
|
4
|
+
GREEN_L = 0.587
|
5
|
+
BLUE_L = 0.114
|
6
|
+
|
7
|
+
delegate :red, :green, :blue, to: :rgb
|
8
|
+
|
9
|
+
def initialize(color)
|
10
|
+
@rgb = HexToRGBConverter.convert(color)
|
11
|
+
end
|
12
|
+
|
13
|
+
def calculate
|
14
|
+
@luma ||= ((RED_L * red) + (GREEN_L * green) + (BLUE_L * blue))/255
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
attr_reader :rgb
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module RGBUtils
|
2
|
+
class RelativeLuminanceCalculator < Calculator
|
3
|
+
RED_Y = 0.2126
|
4
|
+
GREEN_Y = 0.7152
|
5
|
+
BLUE_Y = 0.0722
|
6
|
+
|
7
|
+
delegate :red, :green, :blue, to: :linear_rgb
|
8
|
+
|
9
|
+
def initialize(rgb)
|
10
|
+
@linear_rgb = RGBToLinearRGBConverter.convert(rgb)
|
11
|
+
end
|
12
|
+
|
13
|
+
def calculate
|
14
|
+
@luminance ||= (RED_Y * red) + (GREEN_Y * green) + (BLUE_Y * blue)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
attr_reader :linear_rgb
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module RGBUtils
|
2
|
+
class HexToRGBConverter < Converter
|
3
|
+
def initialize(color)
|
4
|
+
@color = color
|
5
|
+
end
|
6
|
+
|
7
|
+
def convert
|
8
|
+
return color if color.is_a?(RGB)
|
9
|
+
|
10
|
+
@rgb ||= begin
|
11
|
+
red, green, blue = capture_colors
|
12
|
+
|
13
|
+
RGB.new(red: red, green: green, blue: blue)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
attr_accessor :color
|
20
|
+
|
21
|
+
def capture_colors
|
22
|
+
@capture_colors ||= begin
|
23
|
+
WebSafeToHexConverter
|
24
|
+
.convert(color)
|
25
|
+
.match(/(\w{2})(\w{2})(\w{2})/)
|
26
|
+
.captures
|
27
|
+
.map { |color_node| color_node.to_i(16) }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module RGBUtils
|
2
|
+
class RGBToHexConverter < Converter
|
3
|
+
def initialize(color)
|
4
|
+
@color = color
|
5
|
+
end
|
6
|
+
|
7
|
+
def convert
|
8
|
+
WebSafeToHexConverter.convert(hex_color)
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
attr_reader :color
|
14
|
+
|
15
|
+
def hex_color
|
16
|
+
@hex_color ||= begin
|
17
|
+
return color unless color.is_a?(RGB)
|
18
|
+
|
19
|
+
[color.red, color.green, color.blue].map do |color_node|
|
20
|
+
'%02x' % color_node
|
21
|
+
end.join
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module RGBUtils
|
2
|
+
class RGBToLinearRGBConverter < Converter
|
3
|
+
GAMMA = 2.4
|
4
|
+
CUTOFF_POINT = 0.03928
|
5
|
+
SLOPE = 12.92
|
6
|
+
|
7
|
+
def initialize(rgb)
|
8
|
+
@rgb = HexToRGBConverter.convert(rgb)
|
9
|
+
end
|
10
|
+
|
11
|
+
def convert
|
12
|
+
@linear_rgb ||= begin
|
13
|
+
linear_red, linear_green, linear_blue = calculate_linear_rgb
|
14
|
+
|
15
|
+
LinearRGB.new(red: linear_red, green: linear_green, blue: linear_blue)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
attr_accessor :rgb
|
22
|
+
|
23
|
+
def calculate_linear_rgb
|
24
|
+
rgb.as_unit_range.map do |color|
|
25
|
+
if color <= CUTOFF_POINT
|
26
|
+
color / SLOPE
|
27
|
+
else
|
28
|
+
((color + 0.055) / 1.055) ** GAMMA
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module RGBUtils
|
2
|
+
class WebSafeToHexConverter < Converter
|
3
|
+
DEFAULT_COLOR = '#000000'.freeze
|
4
|
+
|
5
|
+
def initialize(color)
|
6
|
+
@color = color
|
7
|
+
end
|
8
|
+
|
9
|
+
def convert
|
10
|
+
return DEFAULT_COLOR unless valid?
|
11
|
+
|
12
|
+
result = color_elements
|
13
|
+
result.map! { |c| c * 2 } if web_safe?
|
14
|
+
|
15
|
+
"##{result.join}"
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
attr_reader :color
|
21
|
+
|
22
|
+
def valid?
|
23
|
+
[3, 6].include?(color_elements.count)
|
24
|
+
end
|
25
|
+
|
26
|
+
def web_safe?
|
27
|
+
color_elements.count == 3
|
28
|
+
end
|
29
|
+
|
30
|
+
def color_elements
|
31
|
+
@color_elements ||= color.scan(/\h/)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module RGBUtils
|
2
|
+
class RGB
|
3
|
+
include Virtus.model
|
4
|
+
|
5
|
+
attribute :red, Color
|
6
|
+
attribute :green, Color
|
7
|
+
attribute :blue, Color
|
8
|
+
|
9
|
+
def as_unit_range
|
10
|
+
[red, green, blue].map { |color| color / 255.0 }
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_hex
|
14
|
+
RGBToHexConverter.convert(self)
|
15
|
+
end
|
16
|
+
|
17
|
+
def contrast_color(type = :simple)
|
18
|
+
return SimpleContrastColorResolver.for(self) if type == :simple
|
19
|
+
|
20
|
+
ComplexContrastColorResolver.for(self)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module RGBUtils
|
2
|
+
class ComplexContrastColorResolver < Resolver
|
3
|
+
def initialize(color, options = {})
|
4
|
+
@color = color
|
5
|
+
@light_color = options.fetch(:light_color, Config.light_color)
|
6
|
+
@dark_color = options.fetch(:dark_color, Config.dark_color)
|
7
|
+
end
|
8
|
+
|
9
|
+
def for
|
10
|
+
@result ||= begin
|
11
|
+
return dark_color if luminance > luminance_cutoff
|
12
|
+
|
13
|
+
light_color
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
attr_reader :color, :light_color, :dark_color
|
20
|
+
|
21
|
+
def luminance
|
22
|
+
@luminance ||= RelativeLuminanceCalculator.calculate(color)
|
23
|
+
end
|
24
|
+
|
25
|
+
def luminance_cutoff
|
26
|
+
Math::sqrt(1.05 * 0.05) - 0.05
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module RGBUtils
|
2
|
+
class SimpleContrastColorResolver < Resolver
|
3
|
+
THRESHOLD_VALUE = 186/255.0
|
4
|
+
|
5
|
+
def initialize(color, options = {})
|
6
|
+
@color = color
|
7
|
+
@light_color = options.fetch(:light_color, Config.light_color)
|
8
|
+
@dark_color = options.fetch(:dark_color, Config.dark_color)
|
9
|
+
end
|
10
|
+
|
11
|
+
def for
|
12
|
+
@result ||= begin
|
13
|
+
return dark_color if luma > THRESHOLD_VALUE
|
14
|
+
|
15
|
+
light_color
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
attr_reader :color, :light_color, :dark_color
|
22
|
+
|
23
|
+
def luma
|
24
|
+
@luma ||= LumaCalculator.calculate(color)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/rgb_utils.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'virtus'
|
2
|
+
require 'active_support'
|
3
|
+
require 'active_support/core_ext'
|
4
|
+
|
5
|
+
module RGBUtils
|
6
|
+
%w(
|
7
|
+
*.rb
|
8
|
+
attributes/**/*.rb
|
9
|
+
models/**/*.rb
|
10
|
+
converters/**/*.rb
|
11
|
+
calculators/**/*.rb
|
12
|
+
resolvers/**/*.rb
|
13
|
+
).each do |pattern|
|
14
|
+
files = File.join(File.dirname(__FILE__), 'rgb_utils', pattern)
|
15
|
+
|
16
|
+
Dir[files].each { |file| require file }
|
17
|
+
end
|
18
|
+
end
|
data/rgb_utils.gemspec
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rgb_utils/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'rgb_utils'
|
8
|
+
spec.version = RGBUtils::VERSION
|
9
|
+
spec.authors = ['andrerpbts', 'brunohkbx']
|
10
|
+
spec.email = ['andrerpbts@gmail.com', 'bruno.f.castro12@hotmail.com ']
|
11
|
+
|
12
|
+
spec.summary = %q{A set of RGB functions}
|
13
|
+
spec.description = %q{A set of RGB functions like luminance, converters and constrast resolvers}
|
14
|
+
spec.homepage = 'https://github.com/andrerpbts/rgb_utils'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
|
+
else
|
22
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
23
|
+
'public gem pushes.'
|
24
|
+
end
|
25
|
+
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
f.match(%r{^(test|spec|features)/})
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
spec.add_development_dependency 'bundler', '~> 1.14'
|
34
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
35
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
36
|
+
spec.add_dependency 'activesupport', '>= 3.2'
|
37
|
+
spec.add_dependency 'virtus', '~> 1.0'
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rgb_utils
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- andrerpbts
|
8
|
+
- brunohkbx
|
9
|
+
autorequire:
|
10
|
+
bindir: exe
|
11
|
+
cert_chain: []
|
12
|
+
date: 2017-04-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.14'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.14'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '10.0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '10.0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rspec
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '3.0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '3.0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: activesupport
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '3.2'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '3.2'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: virtus
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '1.0'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '1.0'
|
84
|
+
description: A set of RGB functions like luminance, converters and constrast resolvers
|
85
|
+
email:
|
86
|
+
- andrerpbts@gmail.com
|
87
|
+
- 'bruno.f.castro12@hotmail.com '
|
88
|
+
executables: []
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- ".rspec"
|
94
|
+
- CODE_OF_CONDUCT.md
|
95
|
+
- Gemfile
|
96
|
+
- LICENSE.txt
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- bin/console
|
100
|
+
- bin/setup
|
101
|
+
- lib/rgb_utils.rb
|
102
|
+
- lib/rgb_utils/attributes/color.rb
|
103
|
+
- lib/rgb_utils/calculator.rb
|
104
|
+
- lib/rgb_utils/calculators/luma_calculator.rb
|
105
|
+
- lib/rgb_utils/calculators/relative_luminance_calculator.rb
|
106
|
+
- lib/rgb_utils/config.rb
|
107
|
+
- lib/rgb_utils/converter.rb
|
108
|
+
- lib/rgb_utils/converters/hex_to_rgb_converter.rb
|
109
|
+
- lib/rgb_utils/converters/rgb_to_hex_converter.rb
|
110
|
+
- lib/rgb_utils/converters/rgb_to_linear_rgb_converter.rb
|
111
|
+
- lib/rgb_utils/converters/web_safe_to_hex_converter.rb
|
112
|
+
- lib/rgb_utils/models/linear_rgb.rb
|
113
|
+
- lib/rgb_utils/models/rgb.rb
|
114
|
+
- lib/rgb_utils/resolver.rb
|
115
|
+
- lib/rgb_utils/resolvers/complex_contrast_color_resolver.rb
|
116
|
+
- lib/rgb_utils/resolvers/simple_contrast_color_resolver.rb
|
117
|
+
- lib/rgb_utils/version.rb
|
118
|
+
- rgb_utils.gemspec
|
119
|
+
homepage: https://github.com/andrerpbts/rgb_utils
|
120
|
+
licenses:
|
121
|
+
- MIT
|
122
|
+
metadata:
|
123
|
+
allowed_push_host: https://rubygems.org
|
124
|
+
post_install_message:
|
125
|
+
rdoc_options: []
|
126
|
+
require_paths:
|
127
|
+
- lib
|
128
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
requirements: []
|
139
|
+
rubyforge_project:
|
140
|
+
rubygems_version: 2.5.1
|
141
|
+
signing_key:
|
142
|
+
specification_version: 4
|
143
|
+
summary: A set of RGB functions
|
144
|
+
test_files: []
|