color 1.8 → 2.0.0.pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +301 -0
  3. data/CODE_OF_CONDUCT.md +128 -0
  4. data/CONTRIBUTING.md +70 -0
  5. data/CONTRIBUTORS.md +10 -0
  6. data/LICENCE.md +27 -0
  7. data/Manifest.txt +11 -23
  8. data/README.md +54 -0
  9. data/Rakefile +74 -61
  10. data/SECURITY.md +34 -0
  11. data/lib/color/cielab.rb +348 -0
  12. data/lib/color/cmyk.rb +279 -213
  13. data/lib/color/grayscale.rb +128 -160
  14. data/lib/color/hsl.rb +205 -173
  15. data/lib/color/rgb/colors.rb +177 -163
  16. data/lib/color/rgb.rb +536 -541
  17. data/lib/color/version.rb +5 -0
  18. data/lib/color/xyz.rb +214 -0
  19. data/lib/color/yiq.rb +91 -46
  20. data/lib/color.rb +208 -142
  21. data/test/fixtures/cielab.json +444 -0
  22. data/test/minitest_helper.rb +20 -4
  23. data/test/test_cmyk.rb +49 -72
  24. data/test/test_color.rb +58 -112
  25. data/test/test_grayscale.rb +35 -57
  26. data/test/test_hsl.rb +71 -77
  27. data/test/test_rgb.rb +195 -267
  28. data/test/test_yiq.rb +12 -30
  29. metadata +90 -107
  30. data/.autotest +0 -5
  31. data/.coveralls.yml +0 -2
  32. data/.gemtest +0 -0
  33. data/.hoerc +0 -2
  34. data/.minitest.rb +0 -2
  35. data/.travis.yml +0 -41
  36. data/Code-of-Conduct.rdoc +0 -41
  37. data/Contributing.rdoc +0 -62
  38. data/Gemfile +0 -9
  39. data/History.rdoc +0 -194
  40. data/Licence.rdoc +0 -27
  41. data/README.rdoc +0 -52
  42. data/lib/color/css.rb +0 -7
  43. data/lib/color/palette/adobecolor.rb +0 -260
  44. data/lib/color/palette/gimp.rb +0 -104
  45. data/lib/color/palette/monocontrast.rb +0 -164
  46. data/lib/color/palette.rb +0 -4
  47. data/lib/color/rgb/contrast.rb +0 -57
  48. data/lib/color/rgb/metallic.rb +0 -28
  49. data/test/test_adobecolor.rb +0 -405
  50. data/test/test_css.rb +0 -19
  51. data/test/test_gimp.rb +0 -87
  52. data/test/test_monocontrast.rb +0 -130
metadata CHANGED
@@ -1,44 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: color
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.8'
4
+ version: 2.0.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Ziegler
8
8
  - Matt Lyon
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-10-26 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: minitest
14
+ name: hoe
16
15
  requirement: !ruby/object:Gem::Requirement
17
16
  requirements:
18
17
  - - "~>"
19
18
  - !ruby/object:Gem::Version
20
- version: '5.8'
19
+ version: '4.0'
21
20
  type: :development
22
21
  prerelease: false
23
22
  version_requirements: !ruby/object:Gem::Requirement
24
23
  requirements:
25
24
  - - "~>"
26
25
  - !ruby/object:Gem::Version
27
- version: '5.8'
26
+ version: '4.0'
28
27
  - !ruby/object:Gem::Dependency
29
- name: rdoc
28
+ name: hoe-halostatue
30
29
  requirement: !ruby/object:Gem::Requirement
31
30
  requirements:
32
31
  - - "~>"
33
32
  - !ruby/object:Gem::Version
34
- version: '4.0'
33
+ version: '2.0'
35
34
  type: :development
36
35
  prerelease: false
37
36
  version_requirements: !ruby/object:Gem::Requirement
38
37
  requirements:
39
38
  - - "~>"
40
39
  - !ruby/object:Gem::Version
41
- version: '4.0'
40
+ version: '2.0'
42
41
  - !ruby/object:Gem::Dependency
43
42
  name: hoe-doofus
44
43
  requirement: !ruby/object:Gem::Requirement
@@ -54,61 +53,61 @@ dependencies:
54
53
  - !ruby/object:Gem::Version
55
54
  version: '1.0'
56
55
  - !ruby/object:Gem::Dependency
57
- name: hoe-gemspec2
56
+ name: hoe-rubygems
58
57
  requirement: !ruby/object:Gem::Requirement
59
58
  requirements:
60
59
  - - "~>"
61
60
  - !ruby/object:Gem::Version
62
- version: '1.1'
61
+ version: '1.0'
63
62
  type: :development
64
63
  prerelease: false
65
64
  version_requirements: !ruby/object:Gem::Requirement
66
65
  requirements:
67
66
  - - "~>"
68
67
  - !ruby/object:Gem::Version
69
- version: '1.1'
68
+ version: '1.0'
70
69
  - !ruby/object:Gem::Dependency
71
- name: hoe-git
70
+ name: hoe-gemspec2
72
71
  requirement: !ruby/object:Gem::Requirement
73
72
  requirements:
74
73
  - - "~>"
75
74
  - !ruby/object:Gem::Version
76
- version: '1.6'
75
+ version: '1.4'
77
76
  type: :development
78
77
  prerelease: false
79
78
  version_requirements: !ruby/object:Gem::Requirement
80
79
  requirements:
81
80
  - - "~>"
82
81
  - !ruby/object:Gem::Version
83
- version: '1.6'
82
+ version: '1.4'
84
83
  - !ruby/object:Gem::Dependency
85
- name: hoe-travis
84
+ name: hoe-git
86
85
  requirement: !ruby/object:Gem::Requirement
87
86
  requirements:
88
87
  - - "~>"
89
88
  - !ruby/object:Gem::Version
90
- version: '1.2'
89
+ version: '1.6'
91
90
  type: :development
92
91
  prerelease: false
93
92
  version_requirements: !ruby/object:Gem::Requirement
94
93
  requirements:
95
94
  - - "~>"
96
95
  - !ruby/object:Gem::Version
97
- version: '1.2'
96
+ version: '1.6'
98
97
  - !ruby/object:Gem::Dependency
99
- name: minitest-around
98
+ name: minitest
100
99
  requirement: !ruby/object:Gem::Requirement
101
100
  requirements:
102
101
  - - "~>"
103
102
  - !ruby/object:Gem::Version
104
- version: '0.3'
103
+ version: '5.8'
105
104
  type: :development
106
105
  prerelease: false
107
106
  version_requirements: !ruby/object:Gem::Requirement
108
107
  requirements:
109
108
  - - "~>"
110
109
  - !ruby/object:Gem::Version
111
- version: '0.3'
110
+ version: '5.8'
112
111
  - !ruby/object:Gem::Dependency
113
112
  name: minitest-autotest
114
113
  requirement: !ruby/object:Gem::Requirement
@@ -123,20 +122,6 @@ dependencies:
123
122
  - - "~>"
124
123
  - !ruby/object:Gem::Version
125
124
  version: '1.0'
126
- - !ruby/object:Gem::Dependency
127
- name: minitest-bisect
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - "~>"
131
- - !ruby/object:Gem::Version
132
- version: '1.2'
133
- type: :development
134
- prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - "~>"
138
- - !ruby/object:Gem::Version
139
- version: '1.2'
140
125
  - !ruby/object:Gem::Dependency
141
126
  name: minitest-focus
142
127
  requirement: !ruby/object:Gem::Requirement
@@ -166,160 +151,158 @@ dependencies:
166
151
  - !ruby/object:Gem::Version
167
152
  version: '0.0'
168
153
  - !ruby/object:Gem::Dependency
169
- name: minitest-pretty_diff
154
+ name: rake
170
155
  requirement: !ruby/object:Gem::Requirement
171
156
  requirements:
172
- - - "~>"
157
+ - - ">="
173
158
  - !ruby/object:Gem::Version
174
- version: '0.1'
159
+ version: '10.0'
160
+ - - "<"
161
+ - !ruby/object:Gem::Version
162
+ version: '14'
175
163
  type: :development
176
164
  prerelease: false
177
165
  version_requirements: !ruby/object:Gem::Requirement
178
166
  requirements:
179
- - - "~>"
167
+ - - ">="
180
168
  - !ruby/object:Gem::Version
181
- version: '0.1'
169
+ version: '10.0'
170
+ - - "<"
171
+ - !ruby/object:Gem::Version
172
+ version: '14'
182
173
  - !ruby/object:Gem::Dependency
183
- name: rake
174
+ name: rdoc
184
175
  requirement: !ruby/object:Gem::Requirement
185
176
  requirements:
186
- - - "~>"
177
+ - - ">="
187
178
  - !ruby/object:Gem::Version
188
- version: '10.0'
179
+ version: '0.0'
189
180
  type: :development
190
181
  prerelease: false
191
182
  version_requirements: !ruby/object:Gem::Requirement
192
183
  requirements:
193
- - - "~>"
184
+ - - ">="
194
185
  - !ruby/object:Gem::Version
195
- version: '10.0'
186
+ version: '0.0'
196
187
  - !ruby/object:Gem::Dependency
197
- name: simplecov
188
+ name: standard
198
189
  requirement: !ruby/object:Gem::Requirement
199
190
  requirements:
200
191
  - - "~>"
201
192
  - !ruby/object:Gem::Version
202
- version: '0.7'
193
+ version: '1.0'
203
194
  type: :development
204
195
  prerelease: false
205
196
  version_requirements: !ruby/object:Gem::Requirement
206
197
  requirements:
207
198
  - - "~>"
208
199
  - !ruby/object:Gem::Version
209
- version: '0.7'
200
+ version: '1.0'
210
201
  - !ruby/object:Gem::Dependency
211
- name: hoe
202
+ name: json
212
203
  requirement: !ruby/object:Gem::Requirement
213
204
  requirements:
214
- - - "~>"
205
+ - - ">="
215
206
  - !ruby/object:Gem::Version
216
- version: '3.14'
207
+ version: '0.0'
217
208
  type: :development
218
209
  prerelease: false
219
210
  version_requirements: !ruby/object:Gem::Requirement
220
211
  requirements:
221
- - - "~>"
212
+ - - ">="
222
213
  - !ruby/object:Gem::Version
223
- version: '3.14'
214
+ version: '0.0'
224
215
  description: |-
225
- Color is a Ruby library to provide basic RGB, CMYK, HSL, and other colourspace
226
- manipulation support to applications that require it. It also provides 152
227
- named RGB colours (184 with spelling variations) that are commonly supported in
228
- HTML, SVG, and X11 applications. A technique for generating monochromatic
229
- contrasting palettes is also included.
216
+ Color is a Ruby library to provide RGB, CMYK, HSL, and other color space
217
+ manipulation support to applications that require it. It provides optional named
218
+ RGB colors that are commonly supported in HTML, # SVG, and X11 applications.
230
219
 
231
- The Color library performs purely mathematical manipulation of the colours
232
- based on colour theory without reference to colour profiles (such as sRGB or
233
- Adobe RGB). For most purposes, when working with RGB and HSL colour spaces,
234
- this won't matter. Absolute colour spaces (like CIE L*a*b* and XYZ) and cannot
235
- be reliably converted to relative colour spaces (like RGB) without colour
236
- profiles.
220
+ The Color library performs purely mathematical manipulation of the colors based
221
+ on color theory without reference to device color profiles (such as sRGB or
222
+ Adobe RGB). For most purposes, when working with RGB and HSL color spaces, this
223
+ won't matter. Absolute color spaces (like CIE LAB and CIE XYZ) cannot be
224
+ reliably converted to relative color spaces (like RGB) without color profiles.
225
+ When necessary for conversions, Color provides D65 and D50 reference white
226
+ values in Color::XYZ.
237
227
 
238
- Color 1.8 adds an alpha parameter to all <tt>#css_rgba</tt> calls, fixes a bug
239
- exposed by new constant lookup semantics in Ruby 2, and ensures that
240
- <tt>Color.equivalent?</tt> can only be called on Color instances.
228
+ Color 2.0 is a major release, dropping support for all versions of Ruby prior to
229
+ 3.2 as well as removing or renaming a number of features. The main breaking
230
+ changes are:
241
231
 
242
- Barring bugs introduced in this release, this (really) is the last version of
243
- color that supports Ruby 1.8, so make sure that your gem specification is set
244
- properly (to <tt>~> 1.8</tt>) if that matters for your application. This
245
- version will no longer be supported one year after the release of color 2.0.
232
+ - Color classes are immutable Data objects; they are no longer mutable.
233
+ - RGB named colors are no longer loaded on gem startup, but must be required
234
+ explicitly (this is _not_ done via `autoload` because there are more than 100
235
+ named colors with spelling variations) with `require "color/rgb/colors"`.
236
+ - Color palettes have been removed.
237
+ - `Color::CSS` and `Color::CSS#[]` have been removed.
246
238
  email:
247
239
  - halostatue@gmail.com
248
240
  - matt@postsomnia.com
249
241
  executables: []
250
242
  extensions: []
251
243
  extra_rdoc_files:
252
- - Code-of-Conduct.rdoc
253
- - Contributing.rdoc
254
- - History.rdoc
255
- - Licence.rdoc
244
+ - CHANGELOG.md
245
+ - CODE_OF_CONDUCT.md
246
+ - CONTRIBUTING.md
247
+ - CONTRIBUTORS.md
248
+ - LICENCE.md
256
249
  - Manifest.txt
257
- - README.rdoc
250
+ - README.md
251
+ - SECURITY.md
258
252
  files:
259
- - ".autotest"
260
- - ".coveralls.yml"
261
- - ".gemtest"
262
- - ".hoerc"
263
- - ".minitest.rb"
264
- - ".travis.yml"
265
- - Code-of-Conduct.rdoc
266
- - Contributing.rdoc
267
- - Gemfile
268
- - History.rdoc
269
- - Licence.rdoc
253
+ - CHANGELOG.md
254
+ - CODE_OF_CONDUCT.md
255
+ - CONTRIBUTING.md
256
+ - CONTRIBUTORS.md
257
+ - LICENCE.md
270
258
  - Manifest.txt
271
- - README.rdoc
259
+ - README.md
272
260
  - Rakefile
261
+ - SECURITY.md
273
262
  - lib/color.rb
263
+ - lib/color/cielab.rb
274
264
  - lib/color/cmyk.rb
275
- - lib/color/css.rb
276
265
  - lib/color/grayscale.rb
277
266
  - lib/color/hsl.rb
278
- - lib/color/palette.rb
279
- - lib/color/palette/adobecolor.rb
280
- - lib/color/palette/gimp.rb
281
- - lib/color/palette/monocontrast.rb
282
267
  - lib/color/rgb.rb
283
268
  - lib/color/rgb/colors.rb
284
- - lib/color/rgb/contrast.rb
285
- - lib/color/rgb/metallic.rb
269
+ - lib/color/version.rb
270
+ - lib/color/xyz.rb
286
271
  - lib/color/yiq.rb
272
+ - test/fixtures/cielab.json
287
273
  - test/minitest_helper.rb
288
- - test/test_adobecolor.rb
289
274
  - test/test_cmyk.rb
290
275
  - test/test_color.rb
291
- - test/test_css.rb
292
- - test/test_gimp.rb
293
276
  - test/test_grayscale.rb
294
277
  - test/test_hsl.rb
295
- - test/test_monocontrast.rb
296
278
  - test/test_rgb.rb
297
279
  - test/test_yiq.rb
298
280
  homepage: https://github.com/halostatue/color
299
281
  licenses:
300
282
  - MIT
301
- metadata: {}
302
- post_install_message:
283
+ metadata:
284
+ source_code_uri: https://github.com/halostatue/color
285
+ bug_tracker_uri: https://github.com/halostatue/color/issues
286
+ changelog_uri: https://github.com/halostatue/color/blob/main/CHANGELOG.md
287
+ rubygems_mfa_required: 'true'
303
288
  rdoc_options:
304
289
  - "--main"
305
- - README.rdoc
290
+ - README.md
306
291
  require_paths:
307
292
  - lib
308
293
  required_ruby_version: !ruby/object:Gem::Requirement
309
294
  requirements:
310
295
  - - ">="
311
296
  - !ruby/object:Gem::Version
312
- version: '0'
297
+ version: '3.2'
313
298
  required_rubygems_version: !ruby/object:Gem::Requirement
314
299
  requirements:
315
300
  - - ">="
316
301
  - !ruby/object:Gem::Version
317
302
  version: '0'
318
303
  requirements: []
319
- rubyforge_project:
320
- rubygems_version: 2.4.8
321
- signing_key:
304
+ rubygems_version: 3.6.9
322
305
  specification_version: 4
323
- summary: Color is a Ruby library to provide basic RGB, CMYK, HSL, and other colourspace
306
+ summary: Color is a Ruby library to provide RGB, CMYK, HSL, and other color space
324
307
  manipulation support to applications that require it
325
308
  test_files: []
data/.autotest DELETED
@@ -1,5 +0,0 @@
1
- # -*- ruby encoding: utf-8 -*-
2
-
3
- Autotest.add_hook :initialize do |at|
4
- at.testlib = ".minitest"
5
- end
data/.coveralls.yml DELETED
@@ -1,2 +0,0 @@
1
- ---
2
- service_name: travis-ci
data/.gemtest DELETED
File without changes
data/.hoerc DELETED
@@ -1,2 +0,0 @@
1
- ---
2
- exclude: !ruby/regexp /(tmp|swp)$|CVS|TAGS|\.(svn|git|hg|DS_Store|idea)|Gemfile\.lock|research\/|\.gemspec$/
data/.minitest.rb DELETED
@@ -1,2 +0,0 @@
1
- gem "minitest"
2
- require "minitest/autorun"
data/.travis.yml DELETED
@@ -1,41 +0,0 @@
1
- ---
2
- language: ruby
3
- rvm:
4
- - 2.2.3
5
- - 2.1.7
6
- - 2.0.0-p647
7
- - ruby-head
8
- - jruby-9.0
9
- - jruby-head
10
- - rbx-2
11
- - jruby-19mode
12
- - 1.9.3
13
- - 1.8.7
14
- - jruby-18mode
15
- - ree
16
- matrix:
17
- allow_failures:
18
- - rvm: 1.9.3
19
- - rvm: rbx-2
20
- - rvm: jruby-head
21
- - rvm: ruby-head
22
- gemfile:
23
- - Gemfile
24
- before_script:
25
- - |
26
- case "${TRAVIS_RUBY_VERSION}" in
27
- rbx*)
28
- gem install psych
29
- ;;
30
- esac
31
- - rake travis:before -t
32
- script: rake travis
33
- after_script:
34
- - rake travis:after -t
35
- notifications:
36
- email:
37
- recipients:
38
- - halostatue@gmail.com
39
- on_success: change
40
- on_failure: always
41
- sudo: false
data/Code-of-Conduct.rdoc DELETED
@@ -1,41 +0,0 @@
1
- == Contributor Code of Conduct
2
-
3
- As contributors and maintainers of this project, and in the interest of
4
- fostering an open and welcoming community, we pledge to respect all people who
5
- contribute through reporting issues, posting feature requests, updating
6
- documentation, submitting pull requests or patches, and other activities.
7
-
8
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, ethnicity, age, religion, or nationality.
12
-
13
- Examples of unacceptable behavior by participants include:
14
-
15
- * The use of sexualized language or imagery
16
- * Personal attacks
17
- * Trolling or insulting/derogatory comments
18
- * Public or private harassment
19
- * Publishing other's private information, such as physical or electronic
20
- addresses, without explicit permission
21
- * Other unethical or unprofessional conduct.
22
-
23
- Project maintainers have the right and responsibility to remove, edit, or
24
- reject comments, commits, code, wiki edits, issues, and other contributions
25
- that are not aligned to this Code of Conduct. By adopting this Code of Conduct,
26
- project maintainers commit themselves to fairly and consistently applying these
27
- principles to every aspect of managing this project. Project maintainers who do
28
- not follow or enforce the Code of Conduct may be permanently removed from the
29
- project team.
30
-
31
- This code of conduct applies both within project spaces and in public spaces
32
- when an individual is representing the project or its community.
33
-
34
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
35
- reported by opening an issue or contacting one or more of the project
36
- maintainers.
37
-
38
- This Code of Conduct is adapted from the
39
- {Contributor Covenant}[http://contributor-covenant.org], version 1.2.0,
40
- available at
41
- {http://contributor-covenant.org/version/1/2/0/}[http://contributor-covenant.org/version/1/2/0/].
data/Contributing.rdoc DELETED
@@ -1,62 +0,0 @@
1
- == Contributing
2
-
3
- I value any contribution to Color you can provide: a bug report, a feature
4
- request, or code contributions.
5
-
6
- Code contributions to Color are especially <del>welcome</del>encouraged.
7
- Because Color is a complex codebase, there are a few guidelines:
8
-
9
- * Changes <strong>will not</strong> be accepted without tests.
10
- * Match my coding style.
11
- * Use a thoughtfully-named topic branch that contains your change. Rebase your
12
- commits into logical chunks as necessary.
13
- * Use {quality commit messages}[http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html].
14
- * Do not change the version number; when your patch is accepted and a release
15
- is made, the version will be updated at that point.
16
- * Submit a GitHub pull request with your changes.
17
- * New features require new documentation.
18
-
19
- === Test Dependencies
20
-
21
- To run the test suite, you will need to install the development dependencies
22
- for Color. If you have Bundler, you can accomplish this easily:
23
-
24
- $ bundle install
25
-
26
- Color uses Ryan Davis’s excellent {Hoe}[https://github.com/seattlerb/hoe]
27
- to manage the release process, and it adds a number of rake tasks. You will
28
- mostly be interested in:
29
-
30
- $ rake
31
-
32
- which runs the tests the same way that:
33
-
34
- $ rake spec
35
- $ rake test
36
- $ rake travis
37
-
38
- will do.
39
-
40
- === Workflow
41
-
42
- Here's the most direct way to get your work merged into the project:
43
-
44
- * Fork the project.
45
- * Clone down your fork (+git clone git://github.com/<username>/color.git+).
46
- * Create a topic branch to contain your change (+git checkout -b my\_awesome\_feature+).
47
- * Hack away, add tests. Not necessarily in that order.
48
- * Make sure everything still passes by running `rake`.
49
- * If necessary, rebase your commits into logical chunks, without errors.
50
- * Push the branch up (+git push origin my\_awesome\_feature+).
51
- * Create a pull request against halostatue/color and describe what your
52
- change does and the why you think it should be merged.
53
-
54
- === Contributors
55
-
56
- * Austin Ziegler created color-tools.
57
- * Matt Lyons created color.
58
- * Dave Heitzman (contrast comparison)
59
- * Thomas Sawyer
60
- * Aaron Hill (CIE94 colour matching)
61
- * Luke Bennellick
62
- * Matthew Draper
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- # NOTE: This file is present to keep Travis CI happy. Edits to it will not
4
- # be accepted.
5
-
6
- source "https://rubygems.org/"
7
- gemspec
8
-
9
- # vim: syntax=ruby