color_diff 0.1 → 0.2

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 (4) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +25 -19
  3. data/lib/color_diff/version.rb +1 -1
  4. metadata +6 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d4856b49dfb2ca4f6fc555def253b3aa586cdc01
4
- data.tar.gz: 1f38316a2e62d067e0edf4772f03d787bc057be2
2
+ SHA256:
3
+ metadata.gz: b0fe61a7d235abdaf531ed9aed4b8f8e5d582880aac3934818b528dda4e3b6e5
4
+ data.tar.gz: 7a7ae004f39490604a2f5882341c2d71d25a854163ec9abc1aea2ad4a319cc3b
5
5
  SHA512:
6
- metadata.gz: 6d9d78fb545168a91a75f303a8e5f3fa36bd32bac2057b27621ccd992954ebf97d3ddc8a800d4575e439bab248910859f0f662113f38155716254b09d881356d
7
- data.tar.gz: faceec60200cf5b91ad725db8d9400d329c6ba6a55aeb426f0f4a3b6f3f022af6381bc0eb5426da03e0df9460be88ed6da5146b3fab49dae2447777924f63ec4
6
+ metadata.gz: 8d5619fecb9b42101e42955c1c8e2e2c70b568aa15b537814b871aa7f5319eba041fb7e27c32df331669e2ce121a12c1dca4e1e32bfa50919186696dc3be40b4
7
+ data.tar.gz: fa8d3a35a3742a9a6759d889feac9a3ef7cdf7fa0cef2bc4a617bb1c30edf08dba6314ddc9c63b4fff2342ab4b23c494f3148d043d6dfa5e778fe484e19b7c4f
data/README.md CHANGED
@@ -10,32 +10,38 @@ Calculating differences between colors using the CIEDE2000 algorithm
10
10
 
11
11
  Difference between two colors:
12
12
 
13
- yellow = ColorDiff::Color::RGB.new 255, 255, 0
14
- gold = ColorDiff::Color::RGB.new 255, 215, 0
13
+ ```ruby
14
+ yellow = ColorDiff::Color::RGB.new 255, 255, 0
15
+ gold = ColorDiff::Color::RGB.new 255, 215, 0
15
16
 
16
- ColorDiff.between yellow, gold
17
- # => 11.584521223499245
17
+ ColorDiff.between yellow, gold
18
+ # => 11.584521223499245
19
+ ```
18
20
 
19
21
  Picking the most similar color from a list:
20
22
 
21
- red = ColorDiff::Color::RGB.new 255, 0, 0
22
- blue = ColorDiff::Color::RGB.new 0, 0, 255
23
- yellow = ColorDiff::Color::RGB.new 255, 255, 0
24
- gold = ColorDiff::Color::RGB.new 255, 215, 0
23
+ ```ruby
24
+ red = ColorDiff::Color::RGB.new 255, 0, 0
25
+ blue = ColorDiff::Color::RGB.new 0, 0, 255
26
+ yellow = ColorDiff::Color::RGB.new 255, 255, 0
27
+ gold = ColorDiff::Color::RGB.new 255, 215, 0
25
28
 
26
- list = ColorDiff::List.new [red, blue, yellow]
27
- list.closest_to(gold) == yellow
28
- # => true
29
+ list = ColorDiff::List.new [red, blue, yellow]
30
+ list.closest_to(gold) == yellow
31
+ # => true
32
+ ```
29
33
 
30
34
  Building a map of nearest match colors from a finite palette:
31
35
 
32
- red = ColorDiff::Color::RGB.new 255, 0, 0
33
- black = ColorDiff::Color::RGB.new 0, 0, 0
34
- dark_gray = ColorDiff::Color::RGB.new 80, 80, 80
35
- maroon = ColorDiff::Color::RGB.new 128, 0, 0
36
+ ```ruby
37
+ red = ColorDiff::Color::RGB.new 255, 0, 0
38
+ black = ColorDiff::Color::RGB.new 0, 0, 0
39
+ dark_gray = ColorDiff::Color::RGB.new 80, 80, 80
40
+ maroon = ColorDiff::Color::RGB.new 128, 0, 0
36
41
 
37
- list = ColorDiff::List.new [red, black]
38
- palette = [dark_gray, maroon]
42
+ list = ColorDiff::List.new [red, black]
43
+ palette = [dark_gray, maroon]
39
44
 
40
- list.closest_to_map(palette)
41
- # => { 'R255G0B0' => maroon, 'R0B0G0' => dark_gray }
45
+ list.closest_to_map(palette)
46
+ # => { 'R255G0B0' => maroon, 'R0B0G0' => dark_gray }
47
+ ```
@@ -1,3 +1,3 @@
1
1
  module ColorDiff
2
- VERSION = '0.1'
2
+ VERSION = '0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: color_diff
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Hanson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-15 00:00:00.000000000 Z
11
+ date: 2025-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -43,7 +43,7 @@ homepage: https://github.com/hansondr/color_diff
43
43
  licenses:
44
44
  - MIT
45
45
  metadata: {}
46
- post_install_message:
46
+ post_install_message:
47
47
  rdoc_options: []
48
48
  require_paths:
49
49
  - lib
@@ -58,9 +58,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  requirements: []
61
- rubyforge_project:
62
- rubygems_version: 2.6.8
63
- signing_key:
61
+ rubygems_version: 3.5.22
62
+ signing_key:
64
63
  specification_version: 4
65
64
  summary: Calculate rgb color distances using CIEDE2000 formula
66
65
  test_files: []