color 2.0.0.pre.0 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -2
- data/lib/color/rgb.rb +5 -0
- data/lib/color/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d67585f5f81335c4e8f679912c4600f5cd183bcfe6072bc40c458a8d825fde4
|
4
|
+
data.tar.gz: 0b6a1c7c6b090805d8df447e3e5e86940d1e07b12e3400d90d1ae0c523f37ab6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aea11ce9923c90da5ac785fa0d314eb3dce2c4aacd919e5a522d5f0ee1d6b6ef2158890985d8a0c32b7db596a9043529a1f3c94ba70d9489f07c28f18e8a50a2
|
7
|
+
data.tar.gz: 5613ee60327f1ec52a56275fdf8af4d0a39b46dcfbecdb69a5e1f7b6037cc8e029228445410cb310ee85784e5574b58d9715f4c0bf76c87fc31c7b90eaf21bae
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## 2.0.0.pre.
|
3
|
+
## 2.0.0.pre.1 / 2025-06-16
|
4
4
|
|
5
5
|
Color 2.0.0 is a major release of the Color library.
|
6
6
|
|
@@ -56,7 +56,10 @@ this release without warning.
|
|
56
56
|
- The `#html` method has been removed from all color classes except Color::RGB.
|
57
57
|
|
58
58
|
- Named RGB colors are no longer defined automatically, but must be loaded
|
59
|
-
explicitly by requiring `color/rgb/colors`. This resolves [#30][issue-30].
|
59
|
+
explicitly by requiring `color/rgb/colors`. This resolves [#30][issue-30]. The
|
60
|
+
use of `Color::RGB#extract_colors`, `Color::RGB.by_hex`, `Color::RGB.by_name`,
|
61
|
+
or `Color::RGB.by_css` will require `color/rgb/colors` automatically as they
|
62
|
+
require the presence of the named colors.
|
60
63
|
|
61
64
|
- `Color:CSS#[]` has been removed, as has the containing namespace. It has
|
62
65
|
always been a shallow wrapper around `Color::RGB.by_name`.
|
data/lib/color/rgb.rb
CHANGED
@@ -638,6 +638,7 @@ class << Color::RGB
|
|
638
638
|
##
|
639
639
|
# Extract named or hex colors from the provided text.
|
640
640
|
def extract_colors(text, mode = :both)
|
641
|
+
require "color/rgb/colors"
|
641
642
|
text = text.downcase
|
642
643
|
regex = case mode
|
643
644
|
when :name
|
@@ -646,6 +647,8 @@ class << Color::RGB
|
|
646
647
|
Regexp.union(__by_hex.keys)
|
647
648
|
when :both
|
648
649
|
Regexp.union(__by_hex.keys + __by_name.keys)
|
650
|
+
else
|
651
|
+
raise ArgumentError, "Unknown mode #{mode}"
|
649
652
|
end
|
650
653
|
|
651
654
|
text.scan(regex).map { |match|
|
@@ -683,11 +686,13 @@ class << Color::RGB
|
|
683
686
|
|
684
687
|
##
|
685
688
|
def __by_hex # :nodoc:
|
689
|
+
require "color/rgb/colors"
|
686
690
|
@__by_hex ||= {}
|
687
691
|
end
|
688
692
|
|
689
693
|
##
|
690
694
|
def __by_name # :nodoc:
|
695
|
+
require "color/rgb/colors"
|
691
696
|
@__by_name ||= {}
|
692
697
|
end
|
693
698
|
|
data/lib/color/version.rb
CHANGED