color-name-list 13.19.1 โ 13.19.3
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.
- package/.github/workflows/build.yml +5 -3
- package/CONTRIBUTING.md +3 -0
- package/README.md +70 -49
- package/dist/colornames.bestof.csv +4710 -4710
- package/dist/colornames.bestof.html +1 -1
- package/dist/colornames.bestof.scss +1 -1
- package/dist/colornames.bestof.toon +1 -1
- package/dist/colornames.bestof.xml +1 -1
- package/dist/colornames.bestof.yaml +1 -1
- package/dist/colornames.csv +29991 -29991
- package/dist/colornames.html +1 -1
- package/dist/colornames.scss +1 -1
- package/dist/colornames.short.csv +2965 -2965
- package/dist/colornames.short.html +1 -1
- package/dist/colornames.short.scss +1 -1
- package/dist/colornames.short.toon +1 -1
- package/dist/colornames.short.xml +1 -1
- package/dist/colornames.short.yaml +1 -1
- package/dist/colornames.toon +1 -1
- package/dist/colornames.xml +1 -1
- package/dist/colornames.yaml +1 -1
- package/package.json +1 -1
- package/scripts/build.js +9 -5
- package/scripts/sortSrc.js +2 -2
- package/tests/validations.test.js +22 -9
|
@@ -27,20 +27,22 @@ jobs:
|
|
|
27
27
|
run: |
|
|
28
28
|
corepack enable
|
|
29
29
|
corepack prepare npm@11.6.0 --activate
|
|
30
|
+
- name: Sort colors
|
|
31
|
+
run: npm run sort-colors
|
|
30
32
|
- name: Build
|
|
31
33
|
run: npm run build
|
|
32
34
|
- run: npm test
|
|
33
35
|
- name: Check for changes
|
|
34
36
|
id: git-check
|
|
35
37
|
run: |
|
|
36
|
-
git diff --quiet README.md changes.svg || echo "has_changes=true" >> $GITHUB_OUTPUT
|
|
38
|
+
git diff --quiet src/colornames.csv README.md changes.svg || echo "has_changes=true" >> $GITHUB_OUTPUT
|
|
37
39
|
- name: Commit updated README and SVG
|
|
38
40
|
if: steps.git-check.outputs.has_changes == 'true'
|
|
39
41
|
run: |
|
|
40
42
|
git config --local user.email "action@github.com"
|
|
41
43
|
git config --local user.name "GitHub Action"
|
|
42
|
-
git add README.md changes.svg
|
|
43
|
-
git commit -m "
|
|
44
|
+
git add src/colornames.csv README.md changes.svg
|
|
45
|
+
git commit -m "chore: sort colors and update docs [skip ci]"
|
|
44
46
|
- name: Push changes
|
|
45
47
|
if: steps.git-check.outputs.has_changes == 'true'
|
|
46
48
|
uses: ad-m/github-push-action@master
|
package/CONTRIBUTING.md
CHANGED
|
@@ -26,6 +26,9 @@ interactions with the project.
|
|
|
26
26
|
- CI may update `README.md` and `changes.svg` automatically and push
|
|
27
27
|
to your PR branch.
|
|
28
28
|
- Do not include generated files (`dist/`, `README.md`, `changes.svg`) in commits.
|
|
29
|
+
- For color name changes, only submit updates to `src/colornames.csv`.
|
|
30
|
+
- No need to run `npm run build` locally; CI generates outputs.
|
|
31
|
+
- Optional locally: `npm run lint:markdown` to match CI markdown checks.
|
|
29
32
|
|
|
30
33
|
## Rules for new color names
|
|
31
34
|
|
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
[](https://www.npmjs.com/package/color-name-list)
|
|
14
14
|
[](https://github.com/sponsors/meodai)
|
|
15
15
|
|
|
16
|
-
A meticulously curated collection of __29991__ unique color names,
|
|
17
|
-
[
|
|
16
|
+
A meticulously curated collection of __29991__ unique color names, built from
|
|
17
|
+
[many sources](#sources-) and thousands of community contributions.
|
|
18
18
|
|
|
19
19
|
> The names of color function like a thread attached to a frightfully slender
|
|
20
20
|
> needle, capable of stitching together our most delicate emotions and memories.
|
|
@@ -22,14 +22,14 @@ A meticulously curated collection of __29991__ unique color names, sourced from
|
|
|
22
22
|
> __Kenya Hara โ White__
|
|
23
23
|
|
|
24
24
|
<p>
|
|
25
|
-
<a href="#explore-">Explore
|
|
26
|
-
| <a href="#
|
|
27
|
-
| <a href="#usage-">Usage</a>
|
|
25
|
+
<a href="#explore-">Explore & search names</a>
|
|
26
|
+
| <a href="#usage-">Use via JS / API</a>
|
|
28
27
|
| <a href="#cdn-">CDN</a>
|
|
29
|
-
| <a href="#
|
|
30
|
-
| <a href="#
|
|
31
|
-
| <a href="#
|
|
28
|
+
| <a href="#color-distribution-">Color distribution</a>
|
|
29
|
+
| <a href="#color-name-submission-">Submit a new name</a>
|
|
30
|
+
| <a href="#sources-">Sources</a>
|
|
32
31
|
| <a href="#costs--sponsors">Sponsors</a>
|
|
32
|
+
| <a href="#latest-color-names-">Latest color names</a>
|
|
33
33
|
</p>
|
|
34
34
|
|
|
35
35
|
## About ๐
|
|
@@ -39,17 +39,67 @@ while maintaining high standards for name quality. We have merged numerous
|
|
|
39
39
|
[lists](#sources-), resolved duplicate names with different hex values,
|
|
40
40
|
and adjusted colors where identical values had different names.
|
|
41
41
|
|
|
42
|
+
## A List Apart ๐
|
|
43
|
+
|
|
44
|
+
Unlike many other color lists, this collection has a
|
|
45
|
+
[__permissive license__](LICENSE), is __strictly__ curated, and
|
|
46
|
+
[__automations__](tests/) ensure the highest quality:
|
|
47
|
+
|
|
48
|
+
- __Single, comprehensive archive__ ๐: Digital-friendly color names in one
|
|
49
|
+
place for design systems, creative tools, data viz, and code.
|
|
50
|
+
- __No clutter, no clones__ ๐งน: Smart checks catch duplicates and
|
|
51
|
+
"almost-duplicates" so names and hex values stay unique.
|
|
52
|
+
- __Consistent naming rules__ โ๏ธ: Strict formatting for
|
|
53
|
+
[APA Title Case](CONTRIBUTING.md#capitalization-rules), language-specific
|
|
54
|
+
articles, normalized "and" forms, and proper apostrophes.
|
|
55
|
+
- __Valid, unique data__ โ
: Every entry has a valid hex code, no stray
|
|
56
|
+
whitespace, and no duplicate names or values.
|
|
57
|
+
- __Grown by a global community__ ๐: Thousands of contributors keep the
|
|
58
|
+
list fresh, weird, poetic, and alive.
|
|
59
|
+
- __Humanly curated__ ๐ง : Automation helps, but humans still guard, review,
|
|
60
|
+
and shape the list so it stays intentional and fun.
|
|
61
|
+
- __Open and permissive__ ๐ชช: Free to use, remix, fork, and build on โ no
|
|
62
|
+
licensing headaches.
|
|
63
|
+
- __Inclusive naming__ ๐ค: Slurs, hate speech, and protected brand names are
|
|
64
|
+
not accepted.
|
|
65
|
+
|
|
66
|
+
## Usage ๐
|
|
67
|
+
|
|
68
|
+
Install via npm:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm install color-name-list
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Minimal JS example:
|
|
75
|
+
|
|
76
|
+
```javascript
|
|
77
|
+
import { colornames } from 'color-name-list';
|
|
78
|
+
|
|
79
|
+
const white = colornames.find((c) => c.hex === '#ffffff');
|
|
80
|
+
console.log(white?.name); // => White
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
See [docs/usage-js.md](docs/usage-js.md) for more
|
|
84
|
+
examples and utilities.
|
|
85
|
+
|
|
86
|
+
Other language implementations maintained by the community:
|
|
87
|
+
|
|
88
|
+
- JS/TS: [docs/usage-js.md](docs/usage-js.md)
|
|
89
|
+
- Java/Kotlin: [docs/usage-java-kotlin.md](docs/usage-java-kotlin.md)
|
|
90
|
+
- C#: [docs/usage-csharp.md](docs/usage-csharp.md)
|
|
91
|
+
- Rust: [docs/usage-rust.md](docs/usage-rust.md)
|
|
92
|
+
|
|
42
93
|
## Explore ๐
|
|
43
94
|
|
|
44
|
-
- [Color Picker & Name Search]: Click the wheel to discover a color name
|
|
45
|
-
or
|
|
46
|
-
- [Color Picker]: Click the colored area
|
|
47
|
-
value below the name.
|
|
95
|
+
- [Color Picker & Name Search]: Click the wheel to discover a color name
|
|
96
|
+
or search by text.
|
|
97
|
+
- [Color Picker]: Click the colored area or enter a hex value below the name.
|
|
48
98
|
- [Color Picker II]: Move your mouse and scroll to select a color.
|
|
49
|
-
- [Name Search]:
|
|
50
|
-
- [Color Distribution]:
|
|
99
|
+
- [Name Search]: Full-text search on the color list.
|
|
100
|
+
- [Color Distribution]: 3D visualization of all color names in various
|
|
51
101
|
color models.
|
|
52
|
-
- [Twitter Bot]: Posts random colors and
|
|
102
|
+
- [Twitter Bot]: Posts random colors and lets you submit new ones.
|
|
53
103
|
|
|
54
104
|
## Color Name Submission ๐
|
|
55
105
|
|
|
@@ -63,16 +113,8 @@ Please review the [naming rules](CONTRIBUTING.md) before contributing!
|
|
|
63
113
|
To contribute via Git, edit the `src/colornames.csv` file
|
|
64
114
|
and ensure tests pass locally (`npm test`).
|
|
65
115
|
|
|
66
|
-
See the full guidelines in [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
67
|
-
|
|
68
|
-
CI notes:
|
|
69
|
-
|
|
70
|
-
- Pull Requests run `npm ci`, `npm run build`, and `npm test`.
|
|
71
|
-
- CI auto-updates `README.md` and `changes.svg` if needed and pushes to your PR branch.
|
|
72
|
-
- Do not commit generated files (`dist/`, `changes.svg`).
|
|
73
|
-
- For color name changes, only submit updates to `src/colornames.csv`.
|
|
74
|
-
- No need to run `npm run build` locally; CI generates outputs.
|
|
75
|
-
- Optional locally: `npm run lint:markdown` to match CI markdown checks.
|
|
116
|
+
See the full guidelines in [CONTRIBUTING.md](CONTRIBUTING.md) for naming
|
|
117
|
+
rules, capitalization, CI behavior, and more.
|
|
76
118
|
|
|
77
119
|
## Color Count: __29991__ ๐
|
|
78
120
|
|
|
@@ -88,18 +130,6 @@ returns the closest `RGB` color to a given `HEX` value. To prevent too many
|
|
|
88
130
|
colors from mapping to the same name, we strive for an even distribution in
|
|
89
131
|
color space: [Visualization](https://codepen.io/meodai/full/zdgXJj/)
|
|
90
132
|
|
|
91
|
-
## Usage ๐
|
|
92
|
-
|
|
93
|
-
### Docs
|
|
94
|
-
|
|
95
|
-
While the tooling and list are primarily in JavaScript/TypeScript, there are several
|
|
96
|
-
other implementations maintained by the community:
|
|
97
|
-
|
|
98
|
-
- JS/TS: [docs/usage-js.md](docs/usage-js.md)
|
|
99
|
-
- Java/Kotlin: [docs/usage-java-kotlin.md](docs/usage-java-kotlin.md)
|
|
100
|
-
- C#: [docs/usage-csharp.md](docs/usage-csharp.md)
|
|
101
|
-
- Rust: [docs/usage-rust.md](docs/usage-rust.md)
|
|
102
|
-
|
|
103
133
|
### Consuming the list
|
|
104
134
|
|
|
105
135
|
The list is available in [multiple formats](https://app.unpkg.com/color-name-list/files/dist),
|
|
@@ -133,17 +163,8 @@ your project.
|
|
|
133
163
|
|
|
134
164
|
### Usage JS ๐ฆ
|
|
135
165
|
|
|
136
|
-
|
|
137
|
-
consider the [public
|
|
138
|
-
|
|
139
|
-
Minimal example:
|
|
140
|
-
|
|
141
|
-
```javascript
|
|
142
|
-
import { colornames } from 'color-name-list';
|
|
143
|
-
|
|
144
|
-
const white = colornames.find((c) => c.hex === '#ffffff');
|
|
145
|
-
console.log(white?.name); // => white
|
|
146
|
-
```
|
|
166
|
+
__Bundle size note (1.14 MB)__: For browser usage,
|
|
167
|
+
consider the [public REST API](#api-).
|
|
147
168
|
|
|
148
169
|
More examples: see `docs/usage-js.md`.
|
|
149
170
|
|
|
@@ -153,7 +174,7 @@ To simplify access, we provide a free and public REST API for all color names
|
|
|
153
174
|
and other public name lists. Full API code and documentation are available
|
|
154
175
|
[in this repository](https://github.com/meodai/color-name-api).
|
|
155
176
|
|
|
156
|
-
#### API
|
|
177
|
+
#### API example
|
|
157
178
|
|
|
158
179
|
```url
|
|
159
180
|
https://api.color.pizza/v1/?values=00f,f00,f00&list=bestOf
|