color 2.1.0 → 2.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -3
- data/CODE_OF_CONDUCT.md +152 -114
- data/CONTRIBUTING.md +87 -49
- data/CONTRIBUTORS.md +2 -0
- data/README.md +3 -5
- data/Rakefile +5 -5
- data/SECURITY.md +17 -16
- data/lib/color/cielab.rb +5 -1
- data/lib/color/grayscale.rb +4 -0
- data/lib/color/hsl.rb +4 -4
- data/lib/color/rgb.rb +7 -4
- data/lib/color/version.rb +1 -1
- data/lib/color/xyz.rb +1 -1
- data/test/test_cmyk.rb +62 -33
- data/test/test_grayscale.rb +35 -3
- data/test/test_hsl.rb +72 -36
- data/test/test_rgb.rb +105 -91
- data/test/test_yiq.rb +52 -8
- metadata +20 -50
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 192b04db62242c8531c1ed8f20f9d024b5e0c57c0a97a6452d481ea5f6ca3e77
|
|
4
|
+
data.tar.gz: c588cfff08831c11fe0e977bcc536140ee5c9c765f24be4360fad3f9e71c56cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c38775facf0b320eee6b7ae6774cab01297bb63b4483fc35270f8a4e05c12ea3307bd60e0200c1dce203eb9010cfe5ab8b755a69ec5f9259fdb336a4acd34f7
|
|
7
|
+
data.tar.gz: 1d01a276bcf0048b0ca9e2bfba6f0559fb4dbaf30c712f4cc91d9022a4da333627ffbe051cd31b3e47b4468d5018f27914984d5a77504a9901651bf0f129861f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,39 @@
|
|
|
1
|
-
# Changelog
|
|
1
|
+
# color Changelog
|
|
2
|
+
|
|
3
|
+
## 2.1.2 / 2025-12-30
|
|
4
|
+
|
|
5
|
+
- Updated to Contributor Covenant 3.0 and applied updates to several support
|
|
6
|
+
documents.
|
|
7
|
+
|
|
8
|
+
- Full coverage of conversion tests. Adds CIELAB `to_yiq` and Grayscale `to_xyz`
|
|
9
|
+
methods. Only YIQ now lacks conversions support. Fixed in [#69][pr-69].
|
|
10
|
+
|
|
11
|
+
- Fix an incorrect conversion of CIELAB colors with low lightness to XYZ, which
|
|
12
|
+
caused the Y component to be ~903 times larger than correct. In practice, this
|
|
13
|
+
returned unexpectedly bright colours.
|
|
14
|
+
|
|
15
|
+
This also affected conversion from CIELAB to RGB, CMYK, HSL, YIQ, and
|
|
16
|
+
grayscale, which convert from CIELAB to XYZ as an intermediate step.
|
|
17
|
+
|
|
18
|
+
Reported by @alexwlchan in [#95][issue-95] and fixed in [#96][pr-96].
|
|
19
|
+
|
|
20
|
+
- Fix an incorrect comparison when converting CIE XYZ colors to RGB that could
|
|
21
|
+
raise a `NoMethodError` when constructing the RGB value. The conversion
|
|
22
|
+
incorrectly compared the absolute value of an intermediate value against the
|
|
23
|
+
0.0031308 threshold instead of comparing the original value, causing certain
|
|
24
|
+
negative values to follow the wrong branch and return complex RGB components.
|
|
25
|
+
|
|
26
|
+
This also affected conversion from XYZ to CMYK, HSL, and YIK, and from CIELAB
|
|
27
|
+
to RGB, HSL, YIQ, and Grayscale -- all of which convert from XYZ to RGB as an
|
|
28
|
+
intermediate step.
|
|
29
|
+
|
|
30
|
+
Reported by @alexwlchan in [#92][issue-92] and fixed in [#93][pr-93].
|
|
31
|
+
|
|
32
|
+
## 2.1.1 / 2025-08-08
|
|
33
|
+
|
|
34
|
+
Color 2.1.1 fixes a bug where `Color::RGB::Black` and `Color::RGB::White` are no
|
|
35
|
+
longer defined automatically because they are part of `color/rgb/colors`.
|
|
36
|
+
Internally, this defines `Color::RGB::Black000` and `Color::RGB::WhiteFFF`.
|
|
2
37
|
|
|
3
38
|
## 2.1.0 / 2025-07-20
|
|
4
39
|
|
|
@@ -332,8 +367,13 @@ ownership to contribute it to this project under the licence terms.
|
|
|
332
367
|
[issue-10]: https://github.com/halostatue/color/issues/10
|
|
333
368
|
[issue-30]: https://github.com/halostatue/color/issues/30
|
|
334
369
|
[issue-45]: https://github.com/halostatue/color/issues/45
|
|
370
|
+
[issue-92]: https://github.com/halostatue/color/issues/92
|
|
371
|
+
[issue-95]: https://github.com/halostatue/color/issues/95
|
|
372
|
+
[pr-8]: https://github.com/halostatue/color/pulls/8
|
|
335
373
|
[pr-11]: https://github.com/halostatue/color/pull/11
|
|
336
374
|
[pr-36]: https://github.com/halostatue/color/pull/36
|
|
337
|
-
[pr-46]: https://github.com/halostatue/pull/46
|
|
338
|
-
[pr-
|
|
375
|
+
[pr-46]: https://github.com/halostatue/color/pull/46
|
|
376
|
+
[pr-69]: https://github.com/halostatue/color/pull/69
|
|
377
|
+
[pr-93]: https://github.com/halostatue/color/pull/93
|
|
378
|
+
[pr-96]: https://github.com/halostatue/color/pull/96
|
|
339
379
|
[wp-std-illuminant]: https://en.wikipedia.org/wiki/Standard_illuminant#White_points_of_standard_illuminants
|
data/CODE_OF_CONDUCT.md
CHANGED
|
@@ -1,128 +1,166 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
1
|
+
# Contributor Covenant 3.0 Code of Conduct
|
|
2
2
|
|
|
3
3
|
## Our Pledge
|
|
4
4
|
|
|
5
|
-
We
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
identity
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
or
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
5
|
+
We pledge to make our community welcoming, safe, and equitable for all.
|
|
6
|
+
|
|
7
|
+
We are committed to fostering an environment that respects and promotes the
|
|
8
|
+
dignity, rights, and contributions of all individuals, regardless of
|
|
9
|
+
characteristics including race, ethnicity, caste, color, age, physical
|
|
10
|
+
characteristics, neurodiversity, disability, sex or gender, gender identity or
|
|
11
|
+
expression, sexual orientation, language, philosophy or religion, national or
|
|
12
|
+
social origin, socio-economic position, level of education, or other status. The
|
|
13
|
+
same privileges of participation are extended to everyone who participates in
|
|
14
|
+
good faith and in accordance with this Covenant.
|
|
15
|
+
|
|
16
|
+
## Encouraged Behaviors
|
|
17
|
+
|
|
18
|
+
While acknowledging differences in social norms, we all strive to meet our
|
|
19
|
+
community's expectations for positive behavior. We also understand that our
|
|
20
|
+
words and actions may be interpreted differently than we intend based on
|
|
21
|
+
culture, background, or native language.
|
|
22
|
+
|
|
23
|
+
With these considerations in mind, we agree to behave mindfully toward each
|
|
24
|
+
other and act in ways that center our shared values, including:
|
|
25
|
+
|
|
26
|
+
1. Respecting the **purpose of our community**, our activities, and our ways of
|
|
27
|
+
gathering.
|
|
28
|
+
2. Engaging **kindly and honestly** with others.
|
|
29
|
+
3. Respecting **different viewpoints** and experiences.
|
|
30
|
+
4. **Taking responsibility** for our actions and contributions.
|
|
31
|
+
5. Gracefully giving and accepting **constructive feedback**.
|
|
32
|
+
6. Committing to **repairing harm** when it occurs.
|
|
33
|
+
7. Behaving in other ways that promote and sustain the **well-being of our
|
|
34
|
+
community**.
|
|
35
|
+
|
|
36
|
+
## Restricted Behaviors
|
|
37
|
+
|
|
38
|
+
We agree to restrict the following behaviors in our community. Instances,
|
|
39
|
+
threats, and promotion of these behaviors are violations of this Code of
|
|
40
|
+
Conduct.
|
|
41
|
+
|
|
42
|
+
1. **Harassment.** Violating explicitly expressed boundaries or engaging in
|
|
43
|
+
unnecessary personal attention after any clear request to stop.
|
|
44
|
+
2. **Character attacks.** Making insulting, demeaning, or pejorative comments
|
|
45
|
+
directed at a community member or group of people.
|
|
46
|
+
3. **Stereotyping or discrimination.** Characterizing anyone’s personality or
|
|
47
|
+
behavior on the basis of immutable identities or traits.
|
|
48
|
+
4. **Sexualization.** Behaving in a way that would generally be considered
|
|
49
|
+
inappropriately intimate in the context or purpose of the community.
|
|
50
|
+
5. **Violating confidentiality**. Sharing or acting on someone's personal or
|
|
51
|
+
private information without their permission.
|
|
52
|
+
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm
|
|
53
|
+
toward any person or group.
|
|
54
|
+
7. Behaving in other ways that **threaten the well-being** of our community.
|
|
55
|
+
|
|
56
|
+
### Other Restrictions
|
|
57
|
+
|
|
58
|
+
1. **Misleading identity.** Impersonating someone else for any reason, or
|
|
59
|
+
pretending to be someone else to evade enforcement actions.
|
|
60
|
+
2. **Failing to credit sources.** Not properly crediting the sources of content
|
|
61
|
+
you contribute.
|
|
62
|
+
3. **Promotional materials**. Sharing marketing or other commercial content in a
|
|
63
|
+
way that is outside the norms of the community.
|
|
64
|
+
4. **Irresponsible communication.** Failing to responsibly present content which
|
|
65
|
+
includes, links or describes any other restricted behaviors.
|
|
66
|
+
|
|
67
|
+
## Reporting an Issue
|
|
68
|
+
|
|
69
|
+
Tensions can occur between community members even when they are trying their
|
|
70
|
+
best to collaborate. Not every conflict represents a code of conduct violation,
|
|
71
|
+
and this Code of Conduct reinforces encouraged behaviors and norms that can help
|
|
72
|
+
avoid conflicts and minimize harm.
|
|
73
|
+
|
|
74
|
+
When an incident does occur, it is important to report it promptly. To report a
|
|
75
|
+
possible violation, create a [private security advisory][advisory] — violations
|
|
76
|
+
of this code of conduct are considered security vulnerabilities.
|
|
77
|
+
|
|
78
|
+
Community Moderators take reports of violations seriously and will make every
|
|
79
|
+
effort to respond in a timely manner. They will investigate all reports of code
|
|
80
|
+
of conduct violations, reviewing messages, logs, and recordings, or interviewing
|
|
81
|
+
witnesses and other participants. Community Moderators will keep investigation
|
|
82
|
+
and enforcement actions as transparent as possible while prioritizing safety and
|
|
83
|
+
confidentiality. In order to honor these values, enforcement actions are carried
|
|
84
|
+
out in private with the involved parties, but communicating to the whole
|
|
85
|
+
community may be part of a mutually agreed upon resolution.
|
|
86
|
+
|
|
87
|
+
## Addressing and Repairing Harm
|
|
88
|
+
|
|
89
|
+
If an investigation by the Community Moderators finds that this Code of Conduct
|
|
90
|
+
has been violated, the following enforcement ladder may be used to determine how
|
|
91
|
+
best to repair harm, based on the incident's impact on the individuals involved
|
|
92
|
+
and the community as a whole. Depending on the severity of a violation, lower
|
|
93
|
+
rungs on the ladder may be skipped.
|
|
94
|
+
|
|
95
|
+
1. Warning
|
|
96
|
+
1. Event: A violation involving a single incident or series of incidents.
|
|
97
|
+
2. Consequence: A private, written warning from the Community Moderators.
|
|
98
|
+
3. Repair: Examples of repair include a private written apology,
|
|
99
|
+
acknowledgement of responsibility, and seeking clarification on
|
|
100
|
+
expectations.
|
|
101
|
+
|
|
102
|
+
2. Temporarily Limited Activities
|
|
103
|
+
1. Event: A repeated incidence of a violation that previously resulted in a
|
|
104
|
+
warning, or the first incidence of a more serious violation.
|
|
105
|
+
2. Consequence: A private, written warning with a time-limited cooldown
|
|
106
|
+
period designed to underscore the seriousness of the situation and give
|
|
107
|
+
the community members involved time to process the incident. The cooldown
|
|
108
|
+
period may be limited to particular communication channels or interactions
|
|
109
|
+
with particular community members.
|
|
110
|
+
3. Repair: Examples of repair may include making an apology, using the
|
|
111
|
+
cooldown period to reflect on actions and impact, and being thoughtful
|
|
112
|
+
about re-entering community spaces after the period is over.
|
|
113
|
+
|
|
114
|
+
3. Temporary Suspension
|
|
115
|
+
1. Event: A pattern of repeated violation which the Community Moderators have
|
|
116
|
+
tried to address with warnings, or a single serious violation.
|
|
117
|
+
2. Consequence: A private written warning with conditions for return from
|
|
118
|
+
suspension. In general, temporary suspensions give the person being
|
|
119
|
+
suspended time to reflect upon their behavior and possible corrective
|
|
120
|
+
actions.
|
|
121
|
+
3. Repair: Examples of repair include respecting the spirit of the
|
|
122
|
+
suspension, meeting the specified conditions for return, and being
|
|
123
|
+
thoughtful about how to reintegrate with the community when the suspension
|
|
124
|
+
is lifted.
|
|
125
|
+
|
|
126
|
+
4. Permanent Ban
|
|
127
|
+
1. Event: A pattern of repeated code of conduct violations that other steps
|
|
128
|
+
on the ladder have failed to resolve, or a violation so serious that the
|
|
129
|
+
Community Moderators determine there is no way to keep the community safe
|
|
130
|
+
with this person as a member.
|
|
131
|
+
2. Consequence: Access to all community spaces, tools, and communication
|
|
132
|
+
channels is removed. In general, permanent bans should be rarely used,
|
|
133
|
+
should have strong reasoning behind them, and should only be resorted to
|
|
134
|
+
if working through other remedies has failed to change the behavior.
|
|
135
|
+
3. Repair: There is no possible repair in cases of this severity.
|
|
136
|
+
|
|
137
|
+
This enforcement ladder is intended as a guideline. It does not limit the
|
|
138
|
+
ability of Community Managers to use their discretion and judgment, in keeping
|
|
139
|
+
with the best interests of our community.
|
|
50
140
|
|
|
51
141
|
## Scope
|
|
52
142
|
|
|
53
143
|
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
-
an individual is officially representing the community in public
|
|
55
|
-
Examples of representing our community include using an official email
|
|
56
|
-
posting via an official social media account, or acting as an appointed
|
|
144
|
+
an individual is officially representing the community in public or other
|
|
145
|
+
spaces. Examples of representing our community include using an official email
|
|
146
|
+
address, posting via an official social media account, or acting as an appointed
|
|
57
147
|
representative at an online or offline event.
|
|
58
148
|
|
|
59
|
-
## Enforcement
|
|
60
|
-
|
|
61
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
-
reported to the community leaders responsible for enforcement at [INSERT CONTACT
|
|
63
|
-
METHOD]. All complaints will be reviewed and investigated promptly and fairly.
|
|
64
|
-
|
|
65
|
-
All community leaders are obligated to respect the privacy and security of the
|
|
66
|
-
reporter of any incident.
|
|
67
|
-
|
|
68
|
-
## Enforcement Guidelines
|
|
69
|
-
|
|
70
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
|
71
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
|
72
|
-
|
|
73
|
-
### 1. Correction
|
|
74
|
-
|
|
75
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
76
|
-
unprofessional or unwelcome in the community.
|
|
77
|
-
|
|
78
|
-
**Consequence**: A private, written warning from community leaders, providing
|
|
79
|
-
clarity around the nature of the violation and an explanation of why the
|
|
80
|
-
behavior was inappropriate. A public apology may be requested.
|
|
81
|
-
|
|
82
|
-
### 2. Warning
|
|
83
|
-
|
|
84
|
-
**Community Impact**: A violation through a single incident or series of
|
|
85
|
-
actions.
|
|
86
|
-
|
|
87
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
|
88
|
-
interaction with the people involved, including unsolicited interaction with
|
|
89
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
|
90
|
-
includes avoiding interactions in community spaces as well as external channels
|
|
91
|
-
like social media. Violating these terms may lead to a temporary or permanent
|
|
92
|
-
ban.
|
|
93
|
-
|
|
94
|
-
### 3. Temporary Ban
|
|
95
|
-
|
|
96
|
-
**Community Impact**: A serious violation of community standards, including
|
|
97
|
-
sustained inappropriate behavior.
|
|
98
|
-
|
|
99
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
|
100
|
-
communication with the community for a specified period of time. No public or
|
|
101
|
-
private interaction with the people involved, including unsolicited interaction
|
|
102
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
|
103
|
-
Violating these terms may lead to a permanent ban.
|
|
104
|
-
|
|
105
|
-
### 4. Permanent Ban
|
|
106
|
-
|
|
107
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
|
108
|
-
standards, including sustained inappropriate behavior, harassment of an
|
|
109
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
|
110
|
-
|
|
111
|
-
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
112
|
-
community.
|
|
113
|
-
|
|
114
149
|
## Attribution
|
|
115
150
|
|
|
116
|
-
This Code of Conduct is adapted from the
|
|
117
|
-
|
|
118
|
-
<https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
|
|
151
|
+
This Code of Conduct is adapted from the Contributor Covenant, version 3.0,
|
|
152
|
+
permanently available at <https://www.contributor-covenant.org/version/3/0/>.
|
|
119
153
|
|
|
120
|
-
|
|
121
|
-
|
|
154
|
+
Contributor Covenant is stewarded by the Organization for Ethical Source and
|
|
155
|
+
licensed under CC BY-SA 4.0. To view a copy of this license, visit
|
|
156
|
+
<https://creativecommons.org/licenses/by-sa/4.0/>.
|
|
122
157
|
|
|
123
|
-
For answers to common questions about
|
|
124
|
-
<https://www.contributor-covenant.org/faq>. Translations are
|
|
125
|
-
<https://www.contributor-covenant.org/translations>.
|
|
158
|
+
For answers to common questions about Contributor Covenant, see the FAQ at
|
|
159
|
+
<https://www.contributor-covenant.org/faq>. Translations are provided at
|
|
160
|
+
<https://www.contributor-covenant.org/translations>. Additional enforcement and
|
|
161
|
+
community guideline resources can be found at
|
|
162
|
+
<https://www.contributor-covenant.org/resources>. The enforcement ladder was
|
|
163
|
+
inspired by the work of [Mozilla’s code of conduct team][inclusion].
|
|
126
164
|
|
|
127
|
-
[
|
|
128
|
-
[
|
|
165
|
+
[advisory]: https://github.com/halostatue/color/security/advisories/new
|
|
166
|
+
[inclusion]: https://github.com/mozilla/inclusion
|
data/CONTRIBUTING.md
CHANGED
|
@@ -1,84 +1,122 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
Contribution to
|
|
4
|
-
contributions.
|
|
3
|
+
Contribution to Color is encouraged: bug reports, feature requests, or code
|
|
4
|
+
contributions. New features should be proposed and discussed in an
|
|
5
|
+
[issue][issues].
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
Before contributing patches, please read the [Licence](./LICENCE.md).
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
or otherwise). I use [Standard Ruby][standardrb] for linting and formatting.
|
|
9
|
+
Color is governed under the [Contributor Covenant Code of Conduct][cccoc].
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
into logical chunks as necessary.
|
|
11
|
+
## Code Guidelines
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
I have several guidelines to contributing code through pull requests:
|
|
15
14
|
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
in the `CHANGELOG.md` and provide a link to your PR.)
|
|
15
|
+
- All code changes require tests. In most cases, this will be added or updated
|
|
16
|
+
unit tests. I use [Minitest][minitest].
|
|
19
17
|
|
|
20
|
-
-
|
|
21
|
-
|
|
18
|
+
- I use code formatters, static analysis tools, and linting to ensure consistent
|
|
19
|
+
styles and formatting. There should be no warning output from test run
|
|
20
|
+
processes. I use [Standard Ruby][standardrb].
|
|
22
21
|
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
documentation generators.
|
|
22
|
+
- Proposed changes should be on a thoughtfully-named topic branch and organized
|
|
23
|
+
into logical commit chunks as appropriate.
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
- Use [Conventional Commits][conventional] with my
|
|
26
|
+
[conventions](#commit-conventions).
|
|
28
27
|
|
|
29
|
-
-
|
|
30
|
-
release is made, the version will be updated at that point.
|
|
28
|
+
- Versions must not be updated in pull requests. This means that you must not:
|
|
31
29
|
|
|
32
|
-
- Modify `color.
|
|
33
|
-
|
|
30
|
+
- Modify `VERSION` in `lib/color/version.rb`. When your patch is accepted and
|
|
31
|
+
a release is made, the version will be updated at that point.
|
|
34
32
|
|
|
35
|
-
- Modify
|
|
33
|
+
- Modify `color.gemspec`; it is a generated file. (You _may_ use
|
|
34
|
+
`rake gemspec` to regenerate it if your change involves metadata related to
|
|
35
|
+
gem itself).
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
- Modify the `Gemfile`.
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
be
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
- Documentation should be added or updated as appropriate for new or updated
|
|
40
|
+
functionality. The documentation is RDoc; color does not use extensions that
|
|
41
|
+
may be present in alternative documentation generators.
|
|
42
|
+
|
|
43
|
+
- All GitHub Actions checks marked as required must pass before a pull request
|
|
44
|
+
may be accepted and merged.
|
|
45
|
+
|
|
46
|
+
- Add your name or GitHub handle to `CONTRIBUTORS.md` and a record in the
|
|
47
|
+
`CHANGELOG.md` as a separate commit from your main change. (Follow the style
|
|
48
|
+
in the `CHANGELOG.md` and provide a link to your PR.)
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
the commit message and pull request. If there is evidence of LLM assistance
|
|
47
|
-
without such declaration, the pull request **will be declined**.
|
|
50
|
+
- Include your DCO sign-off in each commit message (see [LICENCE](LICENCE.md)).
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
## AI Contribution Policy
|
|
53
|
+
|
|
54
|
+
Color is a library full of complex math and subtle decisions (some of them
|
|
55
|
+
possibly even wrong). It is extremely important that contributions of any sort
|
|
56
|
+
be well understood by the submitter and that the developer can attest to the
|
|
57
|
+
[Developer Certificate of Origin][dco] for each pull request (see
|
|
58
|
+
[LICENCE](LICENCE.md)).
|
|
59
|
+
|
|
60
|
+
Any contribution (bug, feature request, or pull request) that uses undeclared AI
|
|
61
|
+
output will be rejected.
|
|
51
62
|
|
|
52
63
|
## Test Dependencies
|
|
53
64
|
|
|
54
|
-
|
|
65
|
+
Color uses Ryan Davis's [Hoe][Hoe] to manage the release process, and it adds a
|
|
55
66
|
number of rake tasks. You will mostly be interested in `rake`, which runs the
|
|
56
67
|
tests the same way that `rake test` will do.
|
|
57
68
|
|
|
58
|
-
To assist with the installation of the development dependencies for
|
|
59
|
-
|
|
69
|
+
To assist with the installation of the development dependencies for color, I
|
|
70
|
+
have provided the simplest possible Gemfile pointing to the (generated)
|
|
60
71
|
`color.gemspec` file. This will permit you to do `bundle install` to get the
|
|
61
72
|
development dependencies.
|
|
62
73
|
|
|
63
74
|
You can run tests with code coverage analysis by running `rake coverage`.
|
|
64
75
|
|
|
65
|
-
##
|
|
76
|
+
## Commit Conventions
|
|
77
|
+
|
|
78
|
+
Color has adopted a variation of the Conventional Commits format for commit
|
|
79
|
+
messages. The following types are permitted:
|
|
80
|
+
|
|
81
|
+
| Type | Purpose |
|
|
82
|
+
| ------- | ----------------------------------------------------- |
|
|
83
|
+
| `feat` | A new feature |
|
|
84
|
+
| `fix` | A bug fix |
|
|
85
|
+
| `chore` | A code change that is neither a bug fix nor a feature |
|
|
86
|
+
| `docs` | Documentation updates |
|
|
87
|
+
| `deps` | Dependency updates, including GitHub Actions. |
|
|
88
|
+
|
|
89
|
+
I encourage the use of [Tim Pope's][tpope-qcm] or [Chris Beam's][cbeams]
|
|
90
|
+
guidelines on the writing of commit messages
|
|
91
|
+
|
|
92
|
+
I require the use of [git][trailers1] [trailers][trailers2] for specific
|
|
93
|
+
additional metadata and strongly encourage it for others. The conditionally
|
|
94
|
+
required metadata trailers are:
|
|
95
|
+
|
|
96
|
+
- `Breaking-Change`: if the change is a breaking change. **Do not** use the
|
|
97
|
+
shorthand form (`feat!(scope)`) or `BREAKING CHANGE`.
|
|
98
|
+
|
|
99
|
+
- `Signed-off-by`: this is required for all developers except me, as outlined in
|
|
100
|
+
the [Licence](./LICENCE.md#developer-certificate-of-origin).
|
|
66
101
|
|
|
67
|
-
|
|
102
|
+
- `Fixes` or `Resolves`: If a change fixes one or more open [issues][issues],
|
|
103
|
+
that issue must be included in the `Fixes` or `Resolves` trailer. Multiple
|
|
104
|
+
issues should be listed comma separated in the same trailer:
|
|
105
|
+
`Fixes: #1, #5, #7`, but _may_ appear in separate trailers. While both `Fixes`
|
|
106
|
+
and `Resolves` are synonyms, only _one_ should be used in a given commit or
|
|
107
|
+
pull request.
|
|
68
108
|
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
- Create a topic branch to contain your change
|
|
72
|
-
(`git checkout -b my_awesome_feature`).
|
|
73
|
-
- Hack away, add tests. Not necessarily in that order.
|
|
74
|
-
- Make sure everything still passes by running `rake`.
|
|
75
|
-
- If necessary, rebase your commits into logical chunks, without errors.
|
|
76
|
-
- Push the branch up (`git push origin my_awesome_feature`).
|
|
77
|
-
- Create a pull request against halostatue/color and describe what your change
|
|
78
|
-
does and the why you think it should be merged.
|
|
109
|
+
- `Related to`: If a change does not fix an issue, those issue references should
|
|
110
|
+
be included in this trailer.
|
|
79
111
|
|
|
112
|
+
[cbeams]: https://cbea.ms/git-commit/
|
|
113
|
+
[cccoc]: ./CODE_OF_CONDUCT.md
|
|
114
|
+
[conventional]: https://www.conventionalcommits.org/en/v1.0.0/
|
|
80
115
|
[dco]: licences/dco.txt
|
|
81
116
|
[hoe]: https://github.com/seattlerb/hoe
|
|
117
|
+
[issues]: https://github.com/halostatue/color/issues
|
|
82
118
|
[minitest]: https://github.com/seattlerb/minitest
|
|
83
|
-
[qcm]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
|
84
119
|
[standardrb]: https://github.com/standardrb/standard
|
|
120
|
+
[tpope-qcm]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
|
121
|
+
[trailers1]: https://git-scm.com/docs/git-interpret-trailers
|
|
122
|
+
[trailers2]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---trailerlttokengtltvaluegt
|
data/CONTRIBUTORS.md
CHANGED
data/README.md
CHANGED
|
@@ -22,11 +22,9 @@ reliably converted to relative color spaces (like RGB) without color profiles.
|
|
|
22
22
|
When necessary for conversions, Color provides D65 and D50 reference white
|
|
23
23
|
values in Color::XYZ.
|
|
24
24
|
|
|
25
|
-
Color 2.1 fixes
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
as well as removing or renaming a number of features. The main breaking changes
|
|
29
|
-
are:
|
|
25
|
+
Color 2.1 fixes multiple Color::XYZ bugs. It builds on the Color 2.0 major
|
|
26
|
+
release, dropping support for all versions of Ruby prior to 3.2 as well as
|
|
27
|
+
removing or renaming a number of features. The main breaking changes are:
|
|
30
28
|
|
|
31
29
|
- Color classes are immutable Data objects; they are no longer mutable.
|
|
32
30
|
- RGB named colors are no longer loaded on gem startup, but must be required
|
data/Rakefile
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require "rubygems"
|
|
2
4
|
require "hoe"
|
|
3
5
|
require "rake/clean"
|
|
@@ -30,17 +32,15 @@ hoe = Hoe.spec "color" do
|
|
|
30
32
|
|
|
31
33
|
extra_dev_deps << ["hoe", "~> 4.0"]
|
|
32
34
|
extra_dev_deps << ["hoe-halostatue", "~> 2.1", ">= 2.1.1"]
|
|
33
|
-
extra_dev_deps << ["
|
|
34
|
-
extra_dev_deps << ["minitest", "~> 5.
|
|
35
|
+
extra_dev_deps << ["json", ">= 0.0"]
|
|
36
|
+
extra_dev_deps << ["minitest", "~> 5.16"]
|
|
35
37
|
extra_dev_deps << ["minitest-autotest", "~> 1.0"]
|
|
36
38
|
extra_dev_deps << ["minitest-focus", "~> 1.1"]
|
|
37
|
-
extra_dev_deps << ["minitest-moar", "~> 0.0"]
|
|
38
39
|
extra_dev_deps << ["rake", ">= 10.0", "< 14"]
|
|
39
40
|
extra_dev_deps << ["rdoc", ">= 0.0", "< 7"]
|
|
40
|
-
extra_dev_deps << ["standard", "~> 1.0"]
|
|
41
|
-
extra_dev_deps << ["json", ">= 0.0"]
|
|
42
41
|
extra_dev_deps << ["simplecov", "~> 0.22"]
|
|
43
42
|
extra_dev_deps << ["simplecov-lcov", "~> 0.8"]
|
|
43
|
+
extra_dev_deps << ["standard", "~> 1.0"]
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
Minitest::TestTask.create :test
|
data/SECURITY.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# color Security
|
|
1
|
+
# color Security Policy
|
|
2
2
|
|
|
3
3
|
## LLM-Generated Security Report Policy
|
|
4
4
|
|
|
@@ -8,32 +8,33 @@ agents.
|
|
|
8
8
|
## Supported Versions
|
|
9
9
|
|
|
10
10
|
Security reports are accepted for the most recent major release and the previous
|
|
11
|
-
version for a limited time after the initial major release version.
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
version for a limited time after the initial major release version.
|
|
12
|
+
|
|
13
|
+
After a major release, the previous version will receive full support for three
|
|
14
|
+
months and security support for an additional three months (for a total of six
|
|
15
|
+
months).
|
|
14
16
|
|
|
15
17
|
Because color 1.x supports a wide range of Ruby versions that are themselves end
|
|
16
18
|
of life, security reports will only be accepted when they can be demonstrated on
|
|
17
19
|
Ruby 3.2 or higher.
|
|
18
20
|
|
|
19
|
-
> | Version | Release Date | Support Ends
|
|
20
|
-
> | ------- | ------------ |
|
|
21
|
-
> | 1.x | 2015-10-26 |
|
|
22
|
-
> | 2.x | 2025-
|
|
21
|
+
> | Version | Release Date | Support Ends | Security Support Ends |
|
|
22
|
+
> | ------- | ------------ | ------------ | --------------------- |
|
|
23
|
+
> | 1.x | 2015-10-26 | 2025-11-07 | 2026-02-07 |
|
|
24
|
+
> | 2.x | 2025-08-07 | - | - |
|
|
23
25
|
|
|
24
26
|
## Reporting a Vulnerability
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
[age][age] with the following public key:
|
|
28
|
+
Prefer creating a [private vulnerability report][advisory] with GitHub.
|
|
29
|
+
Alternatively, send an email to [security@ruby.halostatue.ca][email] with the
|
|
30
|
+
text `Color` in the subject. Emails sent to this address should be encrypted
|
|
31
|
+
using [age][age] with the following public key: [age][age] with the following
|
|
32
|
+
public key:
|
|
32
33
|
|
|
33
34
|
```
|
|
34
35
|
age1fc6ngxmn02m62fej5cl30lrvwmxn4k3q2atqu53aatekmnqfwumqj4g93w
|
|
35
36
|
```
|
|
36
37
|
|
|
37
|
-
[
|
|
38
|
-
[email]: mailto:color@halostatue.ca
|
|
38
|
+
[advisory]: https://github.com/halostatue/color/security/advisories/new
|
|
39
39
|
[age]: https://github.com/FiloSottile/age
|
|
40
|
+
[email]: mailto:color@ruby.halostatue.ca
|