chromonym 2.0.0 → 3.1.0
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/NOTICE.md +32 -0
- package/README.md +140 -74
- package/dist/conversions/hsl.d.ts.map +1 -1
- package/dist/conversions/hsl.js.map +1 -1
- package/dist/conversions/hsv.d.ts.map +1 -1
- package/dist/conversions/hsv.js.map +1 -1
- package/dist/identify.d.ts +36 -11
- package/dist/identify.d.ts.map +1 -1
- package/dist/identify.js +34 -19
- package/dist/identify.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/indexing.d.ts +20 -14
- package/dist/indexing.d.ts.map +1 -1
- package/dist/indexing.js +64 -13
- package/dist/indexing.js.map +1 -1
- package/dist/math/editDistance.d.ts +17 -0
- package/dist/math/editDistance.d.ts.map +1 -0
- package/dist/math/editDistance.js +48 -0
- package/dist/math/editDistance.js.map +1 -0
- package/dist/palettes/crayola.d.ts +200 -0
- package/dist/palettes/crayola.d.ts.map +1 -0
- package/dist/palettes/crayola.js +121 -0
- package/dist/palettes/crayola.js.map +1 -0
- package/dist/resolve.d.ts +39 -6
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +39 -12
- package/dist/resolve.js.map +1 -1
- package/package.json +14 -5
- package/dist/conversions/index.d.ts +0 -6
- package/dist/conversions/index.d.ts.map +0 -1
- package/dist/conversions/index.js +0 -6
- package/dist/conversions/index.js.map +0 -1
- package/dist/palettes/index.d.ts +0 -4
- package/dist/palettes/index.d.ts.map +0 -1
- package/dist/palettes/index.js +0 -4
- package/dist/palettes/index.js.map +0 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Crayola crayon colors — canonical subset. ~85 entries covering the
|
|
3
|
+
* current 64-standard box, iconic fluorescents, and widely-recognized
|
|
4
|
+
* modern additions.
|
|
5
|
+
*
|
|
6
|
+
* Keys are Title Case with spaces (`'Granny Smith Apple'`,
|
|
7
|
+
* `'Razzmatazz'`) — how the names are printed on the crayon wrapper.
|
|
8
|
+
* `standardNormalize` strips spaces + case + punctuation on input, so
|
|
9
|
+
* `resolve('granny-smith-apple')` and `resolve('Granny Smith Apple')`
|
|
10
|
+
* both hit the same entry.
|
|
11
|
+
*
|
|
12
|
+
* sRGB values are community-sourced approximations (Wikipedia's
|
|
13
|
+
* well-cited list of Crayola crayon colors). They do not represent
|
|
14
|
+
* a licensed Crayola reference. See NOTICE.md for trademark note.
|
|
15
|
+
*
|
|
16
|
+
* Default metric: `deltaEok`. The Crayola set spans a wide gamut with
|
|
17
|
+
* many saturated brights (fluorescents especially) where CIELAB-based
|
|
18
|
+
* metrics are less perceptually uniform than OKLAB. Same cost profile
|
|
19
|
+
* as deltaE76, better neighbor selection in saturated regions.
|
|
20
|
+
*/
|
|
21
|
+
declare const crayolaColors: {
|
|
22
|
+
readonly Red: '#ee204d';
|
|
23
|
+
readonly 'Red Orange': '#ff5349';
|
|
24
|
+
readonly Orange: '#ff7538';
|
|
25
|
+
readonly 'Yellow Orange': '#ffae42';
|
|
26
|
+
readonly Yellow: '#fce883';
|
|
27
|
+
readonly 'Yellow Green': '#c5e384';
|
|
28
|
+
readonly Green: '#1cac78';
|
|
29
|
+
readonly 'Blue Green': '#0d98ba';
|
|
30
|
+
readonly Blue: '#1f75fe';
|
|
31
|
+
readonly 'Blue Violet': '#7366bd';
|
|
32
|
+
readonly Violet: '#926eae';
|
|
33
|
+
readonly 'Red Violet': '#c0448f';
|
|
34
|
+
readonly Black: '#232323';
|
|
35
|
+
readonly Brown: '#b4674d';
|
|
36
|
+
readonly White: '#ededed';
|
|
37
|
+
readonly Gray: '#95918c';
|
|
38
|
+
readonly 'Carnation Pink': '#ffaacc';
|
|
39
|
+
readonly 'Sky Blue': '#80daeb';
|
|
40
|
+
readonly Tan: '#faa76c';
|
|
41
|
+
readonly Apricot: '#fdd9b5';
|
|
42
|
+
readonly Peach: '#ffcfab';
|
|
43
|
+
readonly 'Cadet Blue': '#b0b7c6';
|
|
44
|
+
readonly Salmon: '#ff9baa';
|
|
45
|
+
readonly 'Forest Green': '#6dae81';
|
|
46
|
+
readonly 'Lemon Yellow': '#fff44f';
|
|
47
|
+
readonly Mahogany: '#cd4a4c';
|
|
48
|
+
readonly Maroon: '#c8385a';
|
|
49
|
+
readonly Bittersweet: '#fd7c6e';
|
|
50
|
+
readonly Sepia: '#a5694f';
|
|
51
|
+
readonly 'Burnt Sienna': '#ea7e5d';
|
|
52
|
+
readonly 'Burnt Orange': '#ff7f49';
|
|
53
|
+
readonly 'Raw Sienna': '#d68a59';
|
|
54
|
+
readonly Silver: '#cdc5c2';
|
|
55
|
+
readonly Gold: '#e7c697';
|
|
56
|
+
readonly Copper: '#dd9475';
|
|
57
|
+
readonly 'Green Yellow': '#f0e891';
|
|
58
|
+
readonly 'Pine Green': '#158078';
|
|
59
|
+
readonly 'Olive Green': '#bab86c';
|
|
60
|
+
readonly Indigo: '#5d76cb';
|
|
61
|
+
readonly Periwinkle: '#c5d0e6';
|
|
62
|
+
readonly Cerulean: '#1dacd6';
|
|
63
|
+
readonly 'Sea Green': '#9fe2bf';
|
|
64
|
+
readonly 'Turquoise Blue': '#77dde7';
|
|
65
|
+
readonly 'Atomic Tangerine': '#ff9966';
|
|
66
|
+
readonly 'Blizzard Blue': '#ace5ee';
|
|
67
|
+
readonly 'Hot Magenta': '#ff1dce';
|
|
68
|
+
readonly 'Laser Lemon': '#fdfc74';
|
|
69
|
+
readonly 'Neon Carrot': '#ffa343';
|
|
70
|
+
readonly 'Purple Pizzazz': '#fe4eda';
|
|
71
|
+
readonly 'Razzle Dazzle Rose': '#ff48d0';
|
|
72
|
+
readonly Razzmatazz: '#e3256b';
|
|
73
|
+
readonly "Screamin' Green": '#76ff7a';
|
|
74
|
+
readonly 'Shocking Pink': '#fb7efd';
|
|
75
|
+
readonly 'Tickle Me Pink': '#fc89ac';
|
|
76
|
+
readonly 'Unmellow Yellow': '#ffff66';
|
|
77
|
+
readonly 'Wild Watermelon': '#fc6c85';
|
|
78
|
+
readonly 'Outrageous Orange': '#ff6e4a';
|
|
79
|
+
readonly 'Electric Lime': '#ceff1d';
|
|
80
|
+
readonly 'Granny Smith Apple': '#a8e4a0';
|
|
81
|
+
readonly 'Macaroni and Cheese': '#ffbd88';
|
|
82
|
+
readonly 'Banana Mania': '#fae7b5';
|
|
83
|
+
readonly 'Caribbean Green': '#1cd3a2';
|
|
84
|
+
readonly Cerise: '#dd4492';
|
|
85
|
+
readonly 'Cotton Candy': '#ffbcd9';
|
|
86
|
+
readonly 'Fuzzy Wuzzy': '#cc6666';
|
|
87
|
+
readonly Inchworm: '#b2ec5d';
|
|
88
|
+
readonly 'Jazzberry Jam': '#ca3767';
|
|
89
|
+
readonly Manatee: '#979aaa';
|
|
90
|
+
readonly 'Mango Tango': '#ff8243';
|
|
91
|
+
readonly Mauvelous: '#ef98aa';
|
|
92
|
+
readonly 'Midnight Blue': '#1a4876';
|
|
93
|
+
readonly 'Navy Blue': '#1974d2';
|
|
94
|
+
readonly 'Pacific Blue': '#1ca9c9';
|
|
95
|
+
readonly 'Piggy Pink': '#fddde6';
|
|
96
|
+
readonly Plum: '#8e4585';
|
|
97
|
+
readonly 'Purple Heart': '#7442c8';
|
|
98
|
+
readonly "Robin's Egg Blue": '#1fcecb';
|
|
99
|
+
readonly 'Royal Purple': '#7851a9';
|
|
100
|
+
readonly Scarlet: '#fc2847';
|
|
101
|
+
readonly Timberwolf: '#dbd7d2';
|
|
102
|
+
readonly Tumbleweed: '#deaa88';
|
|
103
|
+
readonly 'Violet Red': '#f75394';
|
|
104
|
+
readonly 'Vivid Violet': '#8f509d';
|
|
105
|
+
readonly Wisteria: '#cda4de';
|
|
106
|
+
};
|
|
107
|
+
export type CrayolaColorName = keyof typeof crayolaColors;
|
|
108
|
+
export declare const crayola: {
|
|
109
|
+
readonly name: 'crayola';
|
|
110
|
+
readonly colors: {
|
|
111
|
+
readonly Red: '#ee204d';
|
|
112
|
+
readonly 'Red Orange': '#ff5349';
|
|
113
|
+
readonly Orange: '#ff7538';
|
|
114
|
+
readonly 'Yellow Orange': '#ffae42';
|
|
115
|
+
readonly Yellow: '#fce883';
|
|
116
|
+
readonly 'Yellow Green': '#c5e384';
|
|
117
|
+
readonly Green: '#1cac78';
|
|
118
|
+
readonly 'Blue Green': '#0d98ba';
|
|
119
|
+
readonly Blue: '#1f75fe';
|
|
120
|
+
readonly 'Blue Violet': '#7366bd';
|
|
121
|
+
readonly Violet: '#926eae';
|
|
122
|
+
readonly 'Red Violet': '#c0448f';
|
|
123
|
+
readonly Black: '#232323';
|
|
124
|
+
readonly Brown: '#b4674d';
|
|
125
|
+
readonly White: '#ededed';
|
|
126
|
+
readonly Gray: '#95918c';
|
|
127
|
+
readonly 'Carnation Pink': '#ffaacc';
|
|
128
|
+
readonly 'Sky Blue': '#80daeb';
|
|
129
|
+
readonly Tan: '#faa76c';
|
|
130
|
+
readonly Apricot: '#fdd9b5';
|
|
131
|
+
readonly Peach: '#ffcfab';
|
|
132
|
+
readonly 'Cadet Blue': '#b0b7c6';
|
|
133
|
+
readonly Salmon: '#ff9baa';
|
|
134
|
+
readonly 'Forest Green': '#6dae81';
|
|
135
|
+
readonly 'Lemon Yellow': '#fff44f';
|
|
136
|
+
readonly Mahogany: '#cd4a4c';
|
|
137
|
+
readonly Maroon: '#c8385a';
|
|
138
|
+
readonly Bittersweet: '#fd7c6e';
|
|
139
|
+
readonly Sepia: '#a5694f';
|
|
140
|
+
readonly 'Burnt Sienna': '#ea7e5d';
|
|
141
|
+
readonly 'Burnt Orange': '#ff7f49';
|
|
142
|
+
readonly 'Raw Sienna': '#d68a59';
|
|
143
|
+
readonly Silver: '#cdc5c2';
|
|
144
|
+
readonly Gold: '#e7c697';
|
|
145
|
+
readonly Copper: '#dd9475';
|
|
146
|
+
readonly 'Green Yellow': '#f0e891';
|
|
147
|
+
readonly 'Pine Green': '#158078';
|
|
148
|
+
readonly 'Olive Green': '#bab86c';
|
|
149
|
+
readonly Indigo: '#5d76cb';
|
|
150
|
+
readonly Periwinkle: '#c5d0e6';
|
|
151
|
+
readonly Cerulean: '#1dacd6';
|
|
152
|
+
readonly 'Sea Green': '#9fe2bf';
|
|
153
|
+
readonly 'Turquoise Blue': '#77dde7';
|
|
154
|
+
readonly 'Atomic Tangerine': '#ff9966';
|
|
155
|
+
readonly 'Blizzard Blue': '#ace5ee';
|
|
156
|
+
readonly 'Hot Magenta': '#ff1dce';
|
|
157
|
+
readonly 'Laser Lemon': '#fdfc74';
|
|
158
|
+
readonly 'Neon Carrot': '#ffa343';
|
|
159
|
+
readonly 'Purple Pizzazz': '#fe4eda';
|
|
160
|
+
readonly 'Razzle Dazzle Rose': '#ff48d0';
|
|
161
|
+
readonly Razzmatazz: '#e3256b';
|
|
162
|
+
readonly "Screamin' Green": '#76ff7a';
|
|
163
|
+
readonly 'Shocking Pink': '#fb7efd';
|
|
164
|
+
readonly 'Tickle Me Pink': '#fc89ac';
|
|
165
|
+
readonly 'Unmellow Yellow': '#ffff66';
|
|
166
|
+
readonly 'Wild Watermelon': '#fc6c85';
|
|
167
|
+
readonly 'Outrageous Orange': '#ff6e4a';
|
|
168
|
+
readonly 'Electric Lime': '#ceff1d';
|
|
169
|
+
readonly 'Granny Smith Apple': '#a8e4a0';
|
|
170
|
+
readonly 'Macaroni and Cheese': '#ffbd88';
|
|
171
|
+
readonly 'Banana Mania': '#fae7b5';
|
|
172
|
+
readonly 'Caribbean Green': '#1cd3a2';
|
|
173
|
+
readonly Cerise: '#dd4492';
|
|
174
|
+
readonly 'Cotton Candy': '#ffbcd9';
|
|
175
|
+
readonly 'Fuzzy Wuzzy': '#cc6666';
|
|
176
|
+
readonly Inchworm: '#b2ec5d';
|
|
177
|
+
readonly 'Jazzberry Jam': '#ca3767';
|
|
178
|
+
readonly Manatee: '#979aaa';
|
|
179
|
+
readonly 'Mango Tango': '#ff8243';
|
|
180
|
+
readonly Mauvelous: '#ef98aa';
|
|
181
|
+
readonly 'Midnight Blue': '#1a4876';
|
|
182
|
+
readonly 'Navy Blue': '#1974d2';
|
|
183
|
+
readonly 'Pacific Blue': '#1ca9c9';
|
|
184
|
+
readonly 'Piggy Pink': '#fddde6';
|
|
185
|
+
readonly Plum: '#8e4585';
|
|
186
|
+
readonly 'Purple Heart': '#7442c8';
|
|
187
|
+
readonly "Robin's Egg Blue": '#1fcecb';
|
|
188
|
+
readonly 'Royal Purple': '#7851a9';
|
|
189
|
+
readonly Scarlet: '#fc2847';
|
|
190
|
+
readonly Timberwolf: '#dbd7d2';
|
|
191
|
+
readonly Tumbleweed: '#deaa88';
|
|
192
|
+
readonly 'Violet Red': '#f75394';
|
|
193
|
+
readonly 'Vivid Violet': '#8f509d';
|
|
194
|
+
readonly Wisteria: '#cda4de';
|
|
195
|
+
};
|
|
196
|
+
readonly normalize: import("../types.js").NormalizeFn;
|
|
197
|
+
readonly defaultMetric: 'deltaEok';
|
|
198
|
+
};
|
|
199
|
+
export {};
|
|
200
|
+
//# sourceMappingURL=crayola.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crayola.d.ts","sourceRoot":"","sources":["../../src/palettes/crayola.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,aAAa;aAEjB,GAAG,EAAE,SAAS;aACd,YAAY,EAAE,SAAS;aACvB,MAAM,EAAE,SAAS;aACjB,eAAe,EAAE,SAAS;aAC1B,MAAM,EAAE,SAAS;aACjB,cAAc,EAAE,SAAS;aACzB,KAAK,EAAE,SAAS;aAChB,YAAY,EAAE,SAAS;aACvB,IAAI,EAAE,SAAS;aACf,aAAa,EAAE,SAAS;aACxB,MAAM,EAAE,SAAS;aACjB,YAAY,EAAE,SAAS;aAGvB,KAAK,EAAE,SAAS;aAChB,KAAK,EAAE,SAAS;aAChB,KAAK,EAAE,SAAS;aAChB,IAAI,EAAE,SAAS;aA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SAAS;oCACR,SAAS;oCACT,SAAS;sCACP,SAAS;kCACb,SAAS;uCAGJ,SAAS;wCACR,SAAS;iCAChB,SAAS;oCACN,SAAS;yBACpB,SAAS;iCACD,SAAS;gCACV,SAAS;2BACd,SAAS;kCACF,SAAS;0BACjB,SAAS;gCACH,SAAS;4BACb,SAAS;kCACH,SAAS;8BACb,SAAS;iCACN,SAAS;+BACX,SAAS;uBACjB,SAAS;iCACC,SAAS;qCACL,SAAS;iCACb,SAAS;0BAChB,SAAS;6BACN,SAAS;6BACT,SAAS;+BACP,SAAS;iCACP,SAAS;2BACf,SAAS;;;4BASJ,UAAU;CACmB,CAAC","sourcesContent":["import type { Palette } from '../types.js';\nimport { standardNormalize } from './normalize.js';\n\n/**\n * Crayola crayon colors — canonical subset. ~85 entries covering the\n * current 64-standard box, iconic fluorescents, and widely-recognized\n * modern additions.\n *\n * Keys are Title Case with spaces (`'Granny Smith Apple'`,\n * `'Razzmatazz'`) — how the names are printed on the crayon wrapper.\n * `standardNormalize` strips spaces + case + punctuation on input, so\n * `resolve('granny-smith-apple')` and `resolve('Granny Smith Apple')`\n * both hit the same entry.\n *\n * sRGB values are community-sourced approximations (Wikipedia's\n * well-cited list of Crayola crayon colors). They do not represent\n * a licensed Crayola reference. See NOTICE.md for trademark note.\n *\n * Default metric: `deltaEok`. The Crayola set spans a wide gamut with\n * many saturated brights (fluorescents especially) where CIELAB-based\n * metrics are less perceptually uniform than OKLAB. Same cost profile\n * as deltaE76, better neighbor selection in saturated regions.\n */\nconst crayolaColors = {\n // --- Current standard box: the 12 primary/secondary hue wheel ---\n Red: '#ee204d',\n 'Red Orange': '#ff5349',\n Orange: '#ff7538',\n 'Yellow Orange': '#ffae42',\n Yellow: '#fce883',\n 'Yellow Green': '#c5e384',\n Green: '#1cac78',\n 'Blue Green': '#0d98ba',\n Blue: '#1f75fe',\n 'Blue Violet': '#7366bd',\n Violet: '#926eae',\n 'Red Violet': '#c0448f',\n\n // --- Achromatics ---\n Black: '#232323',\n Brown: '#b4674d',\n White: '#ededed',\n Gray: '#95918c',\n\n // --- 64-box additions (pre-1990 core set) ---\n 'Carnation Pink': '#ffaacc',\n 'Sky Blue': '#80daeb',\n Tan: '#faa76c',\n Apricot: '#fdd9b5',\n Peach: '#ffcfab',\n 'Cadet Blue': '#b0b7c6',\n Salmon: '#ff9baa',\n 'Forest Green': '#6dae81',\n 'Lemon Yellow': '#fff44f',\n Mahogany: '#cd4a4c',\n Maroon: '#c8385a',\n Bittersweet: '#fd7c6e',\n Sepia: '#a5694f',\n 'Burnt Sienna': '#ea7e5d',\n 'Burnt Orange': '#ff7f49',\n 'Raw Sienna': '#d68a59',\n\n // --- Metallics ---\n Silver: '#cdc5c2',\n Gold: '#e7c697',\n Copper: '#dd9475',\n\n // --- Earth / nature tones ---\n 'Green Yellow': '#f0e891',\n 'Pine Green': '#158078',\n 'Olive Green': '#bab86c',\n Indigo: '#5d76cb',\n Periwinkle: '#c5d0e6',\n Cerulean: '#1dacd6',\n 'Sea Green': '#9fe2bf',\n 'Turquoise Blue': '#77dde7',\n\n // --- Fluorescents (the iconic \"Neon 24\" era) ---\n 'Atomic Tangerine': '#ff9966',\n 'Blizzard Blue': '#ace5ee',\n 'Hot Magenta': '#ff1dce',\n 'Laser Lemon': '#fdfc74',\n 'Neon Carrot': '#ffa343',\n 'Purple Pizzazz': '#fe4eda',\n 'Razzle Dazzle Rose': '#ff48d0',\n Razzmatazz: '#e3256b',\n \"Screamin' Green\": '#76ff7a',\n 'Shocking Pink': '#fb7efd',\n 'Tickle Me Pink': '#fc89ac',\n 'Unmellow Yellow': '#ffff66',\n 'Wild Watermelon': '#fc6c85',\n 'Outrageous Orange': '#ff6e4a',\n 'Electric Lime': '#ceff1d',\n\n // --- Modern / whimsical additions ---\n 'Granny Smith Apple': '#a8e4a0',\n 'Macaroni and Cheese': '#ffbd88',\n 'Banana Mania': '#fae7b5',\n 'Caribbean Green': '#1cd3a2',\n Cerise: '#dd4492',\n 'Cotton Candy': '#ffbcd9',\n 'Fuzzy Wuzzy': '#cc6666',\n Inchworm: '#b2ec5d',\n 'Jazzberry Jam': '#ca3767',\n Manatee: '#979aaa',\n 'Mango Tango': '#ff8243',\n Mauvelous: '#ef98aa',\n 'Midnight Blue': '#1a4876',\n 'Navy Blue': '#1974d2',\n 'Pacific Blue': '#1ca9c9',\n 'Piggy Pink': '#fddde6',\n Plum: '#8e4585',\n 'Purple Heart': '#7442c8',\n \"Robin's Egg Blue\": '#1fcecb',\n 'Royal Purple': '#7851a9',\n Scarlet: '#fc2847',\n Timberwolf: '#dbd7d2',\n Tumbleweed: '#deaa88',\n 'Violet Red': '#f75394',\n 'Vivid Violet': '#8f509d',\n Wisteria: '#cda4de',\n} as const;\n\nexport type CrayolaColorName = keyof typeof crayolaColors;\n\nexport const crayola = {\n name: 'crayola',\n colors: crayolaColors,\n normalize: standardNormalize,\n defaultMetric: 'deltaEok',\n} as const satisfies Palette<CrayolaColorName>;\n"]}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { standardNormalize } from './normalize.js';
|
|
2
|
+
/**
|
|
3
|
+
* Crayola crayon colors — canonical subset. ~85 entries covering the
|
|
4
|
+
* current 64-standard box, iconic fluorescents, and widely-recognized
|
|
5
|
+
* modern additions.
|
|
6
|
+
*
|
|
7
|
+
* Keys are Title Case with spaces (`'Granny Smith Apple'`,
|
|
8
|
+
* `'Razzmatazz'`) — how the names are printed on the crayon wrapper.
|
|
9
|
+
* `standardNormalize` strips spaces + case + punctuation on input, so
|
|
10
|
+
* `resolve('granny-smith-apple')` and `resolve('Granny Smith Apple')`
|
|
11
|
+
* both hit the same entry.
|
|
12
|
+
*
|
|
13
|
+
* sRGB values are community-sourced approximations (Wikipedia's
|
|
14
|
+
* well-cited list of Crayola crayon colors). They do not represent
|
|
15
|
+
* a licensed Crayola reference. See NOTICE.md for trademark note.
|
|
16
|
+
*
|
|
17
|
+
* Default metric: `deltaEok`. The Crayola set spans a wide gamut with
|
|
18
|
+
* many saturated brights (fluorescents especially) where CIELAB-based
|
|
19
|
+
* metrics are less perceptually uniform than OKLAB. Same cost profile
|
|
20
|
+
* as deltaE76, better neighbor selection in saturated regions.
|
|
21
|
+
*/
|
|
22
|
+
const crayolaColors = {
|
|
23
|
+
// --- Current standard box: the 12 primary/secondary hue wheel ---
|
|
24
|
+
Red: '#ee204d',
|
|
25
|
+
'Red Orange': '#ff5349',
|
|
26
|
+
Orange: '#ff7538',
|
|
27
|
+
'Yellow Orange': '#ffae42',
|
|
28
|
+
Yellow: '#fce883',
|
|
29
|
+
'Yellow Green': '#c5e384',
|
|
30
|
+
Green: '#1cac78',
|
|
31
|
+
'Blue Green': '#0d98ba',
|
|
32
|
+
Blue: '#1f75fe',
|
|
33
|
+
'Blue Violet': '#7366bd',
|
|
34
|
+
Violet: '#926eae',
|
|
35
|
+
'Red Violet': '#c0448f',
|
|
36
|
+
// --- Achromatics ---
|
|
37
|
+
Black: '#232323',
|
|
38
|
+
Brown: '#b4674d',
|
|
39
|
+
White: '#ededed',
|
|
40
|
+
Gray: '#95918c',
|
|
41
|
+
// --- 64-box additions (pre-1990 core set) ---
|
|
42
|
+
'Carnation Pink': '#ffaacc',
|
|
43
|
+
'Sky Blue': '#80daeb',
|
|
44
|
+
Tan: '#faa76c',
|
|
45
|
+
Apricot: '#fdd9b5',
|
|
46
|
+
Peach: '#ffcfab',
|
|
47
|
+
'Cadet Blue': '#b0b7c6',
|
|
48
|
+
Salmon: '#ff9baa',
|
|
49
|
+
'Forest Green': '#6dae81',
|
|
50
|
+
'Lemon Yellow': '#fff44f',
|
|
51
|
+
Mahogany: '#cd4a4c',
|
|
52
|
+
Maroon: '#c8385a',
|
|
53
|
+
Bittersweet: '#fd7c6e',
|
|
54
|
+
Sepia: '#a5694f',
|
|
55
|
+
'Burnt Sienna': '#ea7e5d',
|
|
56
|
+
'Burnt Orange': '#ff7f49',
|
|
57
|
+
'Raw Sienna': '#d68a59',
|
|
58
|
+
// --- Metallics ---
|
|
59
|
+
Silver: '#cdc5c2',
|
|
60
|
+
Gold: '#e7c697',
|
|
61
|
+
Copper: '#dd9475',
|
|
62
|
+
// --- Earth / nature tones ---
|
|
63
|
+
'Green Yellow': '#f0e891',
|
|
64
|
+
'Pine Green': '#158078',
|
|
65
|
+
'Olive Green': '#bab86c',
|
|
66
|
+
Indigo: '#5d76cb',
|
|
67
|
+
Periwinkle: '#c5d0e6',
|
|
68
|
+
Cerulean: '#1dacd6',
|
|
69
|
+
'Sea Green': '#9fe2bf',
|
|
70
|
+
'Turquoise Blue': '#77dde7',
|
|
71
|
+
// --- Fluorescents (the iconic "Neon 24" era) ---
|
|
72
|
+
'Atomic Tangerine': '#ff9966',
|
|
73
|
+
'Blizzard Blue': '#ace5ee',
|
|
74
|
+
'Hot Magenta': '#ff1dce',
|
|
75
|
+
'Laser Lemon': '#fdfc74',
|
|
76
|
+
'Neon Carrot': '#ffa343',
|
|
77
|
+
'Purple Pizzazz': '#fe4eda',
|
|
78
|
+
'Razzle Dazzle Rose': '#ff48d0',
|
|
79
|
+
Razzmatazz: '#e3256b',
|
|
80
|
+
"Screamin' Green": '#76ff7a',
|
|
81
|
+
'Shocking Pink': '#fb7efd',
|
|
82
|
+
'Tickle Me Pink': '#fc89ac',
|
|
83
|
+
'Unmellow Yellow': '#ffff66',
|
|
84
|
+
'Wild Watermelon': '#fc6c85',
|
|
85
|
+
'Outrageous Orange': '#ff6e4a',
|
|
86
|
+
'Electric Lime': '#ceff1d',
|
|
87
|
+
// --- Modern / whimsical additions ---
|
|
88
|
+
'Granny Smith Apple': '#a8e4a0',
|
|
89
|
+
'Macaroni and Cheese': '#ffbd88',
|
|
90
|
+
'Banana Mania': '#fae7b5',
|
|
91
|
+
'Caribbean Green': '#1cd3a2',
|
|
92
|
+
Cerise: '#dd4492',
|
|
93
|
+
'Cotton Candy': '#ffbcd9',
|
|
94
|
+
'Fuzzy Wuzzy': '#cc6666',
|
|
95
|
+
Inchworm: '#b2ec5d',
|
|
96
|
+
'Jazzberry Jam': '#ca3767',
|
|
97
|
+
Manatee: '#979aaa',
|
|
98
|
+
'Mango Tango': '#ff8243',
|
|
99
|
+
Mauvelous: '#ef98aa',
|
|
100
|
+
'Midnight Blue': '#1a4876',
|
|
101
|
+
'Navy Blue': '#1974d2',
|
|
102
|
+
'Pacific Blue': '#1ca9c9',
|
|
103
|
+
'Piggy Pink': '#fddde6',
|
|
104
|
+
Plum: '#8e4585',
|
|
105
|
+
'Purple Heart': '#7442c8',
|
|
106
|
+
"Robin's Egg Blue": '#1fcecb',
|
|
107
|
+
'Royal Purple': '#7851a9',
|
|
108
|
+
Scarlet: '#fc2847',
|
|
109
|
+
Timberwolf: '#dbd7d2',
|
|
110
|
+
Tumbleweed: '#deaa88',
|
|
111
|
+
'Violet Red': '#f75394',
|
|
112
|
+
'Vivid Violet': '#8f509d',
|
|
113
|
+
Wisteria: '#cda4de',
|
|
114
|
+
};
|
|
115
|
+
export const crayola = {
|
|
116
|
+
name: 'crayola',
|
|
117
|
+
colors: crayolaColors,
|
|
118
|
+
normalize: standardNormalize,
|
|
119
|
+
defaultMetric: 'deltaEok',
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=crayola.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crayola.js","sourceRoot":"","sources":["../../src/palettes/crayola.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,aAAa,GAAG;IACpB,mEAAmE;IACnE,GAAG,EAAE,SAAS;IACd,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE,SAAS;IACjB,eAAe,EAAE,SAAS;IAC1B,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,SAAS;IACzB,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,SAAS;IACvB,IAAI,EAAE,SAAS;IACf,aAAa,EAAE,SAAS;IACxB,MAAM,EAAE,SAAS;IACj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EAAE,SAAS;IAE1B,uCAAuC;IACvC,oBAAoB,EAAE,SAAS;IAC/B,qBAAqB,EAAE,SAAS;IAChC,cAAc,EAAE,SAAS;IACzB,iBAAiB,EAAE,SAAS;IAC5B,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,SAAS;IACzB,aAAa,EAAE,SAAS;IACxB,QAAQ,EAAE,SAAS;IACnB,eAAe,EAAE,SAAS;IAC1B,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,SAAS;IACxB,SAAS,EAAE,SAAS;IACpB,eAAe,EAAE,SAAS;IAC1B,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,SAAS;IACzB,YAAY,EAAE,SAAS;IACvB,IAAI,EAAE,SAAS;IACf,cAAc,EAAE,SAAS;IACzB,kBAAkB,EAAE,SAAS;IAC7B,cAAc,EAAE,SAAS;IACzB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,SAAS;IACzB,QAAQ,EAAE,SAAS;CACX,CAAC;AAIX,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,aAAa;IACrB,SAAS,EAAE,iBAAiB;IAC5B,aAAa,EAAE,UAAU;CACmB,CAAC","sourcesContent":["import type { Palette } from '../types.js';\nimport { standardNormalize } from './normalize.js';\n\n/**\n * Crayola crayon colors — canonical subset. ~85 entries covering the\n * current 64-standard box, iconic fluorescents, and widely-recognized\n * modern additions.\n *\n * Keys are Title Case with spaces (`'Granny Smith Apple'`,\n * `'Razzmatazz'`) — how the names are printed on the crayon wrapper.\n * `standardNormalize` strips spaces + case + punctuation on input, so\n * `resolve('granny-smith-apple')` and `resolve('Granny Smith Apple')`\n * both hit the same entry.\n *\n * sRGB values are community-sourced approximations (Wikipedia's\n * well-cited list of Crayola crayon colors). They do not represent\n * a licensed Crayola reference. See NOTICE.md for trademark note.\n *\n * Default metric: `deltaEok`. The Crayola set spans a wide gamut with\n * many saturated brights (fluorescents especially) where CIELAB-based\n * metrics are less perceptually uniform than OKLAB. Same cost profile\n * as deltaE76, better neighbor selection in saturated regions.\n */\nconst crayolaColors = {\n // --- Current standard box: the 12 primary/secondary hue wheel ---\n Red: '#ee204d',\n 'Red Orange': '#ff5349',\n Orange: '#ff7538',\n 'Yellow Orange': '#ffae42',\n Yellow: '#fce883',\n 'Yellow Green': '#c5e384',\n Green: '#1cac78',\n 'Blue Green': '#0d98ba',\n Blue: '#1f75fe',\n 'Blue Violet': '#7366bd',\n Violet: '#926eae',\n 'Red Violet': '#c0448f',\n\n // --- Achromatics ---\n Black: '#232323',\n Brown: '#b4674d',\n White: '#ededed',\n Gray: '#95918c',\n\n // --- 64-box additions (pre-1990 core set) ---\n 'Carnation Pink': '#ffaacc',\n 'Sky Blue': '#80daeb',\n Tan: '#faa76c',\n Apricot: '#fdd9b5',\n Peach: '#ffcfab',\n 'Cadet Blue': '#b0b7c6',\n Salmon: '#ff9baa',\n 'Forest Green': '#6dae81',\n 'Lemon Yellow': '#fff44f',\n Mahogany: '#cd4a4c',\n Maroon: '#c8385a',\n Bittersweet: '#fd7c6e',\n Sepia: '#a5694f',\n 'Burnt Sienna': '#ea7e5d',\n 'Burnt Orange': '#ff7f49',\n 'Raw Sienna': '#d68a59',\n\n // --- Metallics ---\n Silver: '#cdc5c2',\n Gold: '#e7c697',\n Copper: '#dd9475',\n\n // --- Earth / nature tones ---\n 'Green Yellow': '#f0e891',\n 'Pine Green': '#158078',\n 'Olive Green': '#bab86c',\n Indigo: '#5d76cb',\n Periwinkle: '#c5d0e6',\n Cerulean: '#1dacd6',\n 'Sea Green': '#9fe2bf',\n 'Turquoise Blue': '#77dde7',\n\n // --- Fluorescents (the iconic \"Neon 24\" era) ---\n 'Atomic Tangerine': '#ff9966',\n 'Blizzard Blue': '#ace5ee',\n 'Hot Magenta': '#ff1dce',\n 'Laser Lemon': '#fdfc74',\n 'Neon Carrot': '#ffa343',\n 'Purple Pizzazz': '#fe4eda',\n 'Razzle Dazzle Rose': '#ff48d0',\n Razzmatazz: '#e3256b',\n \"Screamin' Green\": '#76ff7a',\n 'Shocking Pink': '#fb7efd',\n 'Tickle Me Pink': '#fc89ac',\n 'Unmellow Yellow': '#ffff66',\n 'Wild Watermelon': '#fc6c85',\n 'Outrageous Orange': '#ff6e4a',\n 'Electric Lime': '#ceff1d',\n\n // --- Modern / whimsical additions ---\n 'Granny Smith Apple': '#a8e4a0',\n 'Macaroni and Cheese': '#ffbd88',\n 'Banana Mania': '#fae7b5',\n 'Caribbean Green': '#1cd3a2',\n Cerise: '#dd4492',\n 'Cotton Candy': '#ffbcd9',\n 'Fuzzy Wuzzy': '#cc6666',\n Inchworm: '#b2ec5d',\n 'Jazzberry Jam': '#ca3767',\n Manatee: '#979aaa',\n 'Mango Tango': '#ff8243',\n Mauvelous: '#ef98aa',\n 'Midnight Blue': '#1a4876',\n 'Navy Blue': '#1974d2',\n 'Pacific Blue': '#1ca9c9',\n 'Piggy Pink': '#fddde6',\n Plum: '#8e4585',\n 'Purple Heart': '#7442c8',\n \"Robin's Egg Blue\": '#1fcecb',\n 'Royal Purple': '#7851a9',\n Scarlet: '#fc2847',\n Timberwolf: '#dbd7d2',\n Tumbleweed: '#deaa88',\n 'Violet Red': '#f75394',\n 'Vivid Violet': '#8f509d',\n Wisteria: '#cda4de',\n} as const;\n\nexport type CrayolaColorName = keyof typeof crayolaColors;\n\nexport const crayola = {\n name: 'crayola',\n colors: crayolaColors,\n normalize: standardNormalize,\n defaultMetric: 'deltaEok',\n} as const satisfies Palette<CrayolaColorName>;\n"]}
|
package/dist/resolve.d.ts
CHANGED
|
@@ -1,16 +1,49 @@
|
|
|
1
|
+
import { web } from './palettes/web.js';
|
|
1
2
|
import type { ColorFormat, ColorValue, Palette } from './types.js';
|
|
3
|
+
/** Extract string keys from a Palette's `colors` map. */
|
|
4
|
+
type PaletteKey<P extends Palette> = Extract<keyof P['colors'], string>;
|
|
2
5
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
+
* One ranked fuzzy-match entry when `resolve` is called with `k`.
|
|
7
|
+
* `distance` is the Levenshtein edit distance between the normalized
|
|
8
|
+
* input and the normalized palette key — integer count of insertions,
|
|
9
|
+
* deletions, and substitutions.
|
|
10
|
+
*/
|
|
11
|
+
export type ResolveMatch<Name extends string> = {
|
|
12
|
+
readonly name: Name;
|
|
13
|
+
readonly value: ColorValue;
|
|
14
|
+
readonly distance: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Resolve a human-readable name to a color. Normalizes the input using
|
|
18
|
+
* the palette's own `normalize` function before looking it up.
|
|
19
|
+
*
|
|
20
|
+
* **Without `k`** (strict, unchanged): returns the exact match value, or
|
|
21
|
+
* `null` if the normalized name isn't in the palette.
|
|
6
22
|
*
|
|
7
|
-
*
|
|
23
|
+
* **With `k`** (fuzzy, typo-tolerant): returns an array of the top `k`
|
|
24
|
+
* matches ranked by Levenshtein edit distance against normalized keys.
|
|
25
|
+
* Useful for user-typed input where misspellings, casing, and
|
|
26
|
+
* punctuation can all be recovered.
|
|
8
27
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* resolve('rebeccapurple') // '#663399'
|
|
30
|
+
* resolve('rebecapurple') // null (strict)
|
|
31
|
+
* resolve('rebecapurple', { palette: web, k: 3 }) // fuzzy:
|
|
32
|
+
* // [{ name: 'rebeccapurple', value: '#663399', distance: 1 },
|
|
33
|
+
* // { name: 'purple', value: '#800080', distance: 6 },
|
|
34
|
+
* // ...]
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Defaults: palette = `web`, format = 'HEX', `k` = undefined (strict).
|
|
11
38
|
*/
|
|
12
39
|
export declare function resolve(name: string, opts?: {
|
|
13
40
|
palette?: Palette;
|
|
14
41
|
format?: ColorFormat;
|
|
15
42
|
}): ColorValue | null;
|
|
43
|
+
export declare function resolve<P extends Palette = typeof web>(name: string, opts: {
|
|
44
|
+
palette?: P;
|
|
45
|
+
format?: ColorFormat;
|
|
46
|
+
k: number;
|
|
47
|
+
}): Array<ResolveMatch<PaletteKey<P>>>;
|
|
48
|
+
export {};
|
|
16
49
|
//# sourceMappingURL=resolve.d.ts.map
|
package/dist/resolve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAY,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAY,OAAO,EAAE,MAAM,YAAY,CAAC;AAO7E,yDAAyD;AACzD,KAAK,UAAU,CAAC,CAAC,SAAS,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;AAExE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,SAAS,MAAM,IAAI;IAC9C,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GACjD,UAAU,GAAG,IAAI,CAAC;AAGrB,wBAAgB,OAAO,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,GAAG,EACpD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["import { hexToRgba } from './conversions/hex.js';\nimport { fromRgba } from './convert.js';\nimport { getNameIndex } from './indexing.js';\nimport { levenshtein } from './math/editDistance.js';\nimport { web } from './palettes/web.js';\nimport type { ColorFormat, ColorValue, HexColor, Palette } from './types.js';\n\n// No built-in palette key exceeds ~30 chars post-normalize; anything well past\n// that can't plausibly win a fuzzy match and risks pathological O(n·m) cost\n// across every palette entry. Guard the k-branch input at 64.\nconst MAX_FUZZY_INPUT_LENGTH = 64;\n\n/** Extract string keys from a Palette's `colors` map. */\ntype PaletteKey<P extends Palette> = Extract<keyof P['colors'], string>;\n\n/**\n * One ranked fuzzy-match entry when `resolve` is called with `k`.\n * `distance` is the Levenshtein edit distance between the normalized\n * input and the normalized palette key — integer count of insertions,\n * deletions, and substitutions.\n */\nexport type ResolveMatch<Name extends string> = {\n readonly name: Name;\n readonly value: ColorValue;\n readonly distance: number;\n};\n\n/**\n * Resolve a human-readable name to a color. Normalizes the input using\n * the palette's own `normalize` function before looking it up.\n *\n * **Without `k`** (strict, unchanged): returns the exact match value, or\n * `null` if the normalized name isn't in the palette.\n *\n * **With `k`** (fuzzy, typo-tolerant): returns an array of the top `k`\n * matches ranked by Levenshtein edit distance against normalized keys.\n * Useful for user-typed input where misspellings, casing, and\n * punctuation can all be recovered.\n *\n * ```ts\n * resolve('rebeccapurple') // '#663399'\n * resolve('rebecapurple') // null (strict)\n * resolve('rebecapurple', { palette: web, k: 3 }) // fuzzy:\n * // [{ name: 'rebeccapurple', value: '#663399', distance: 1 },\n * // { name: 'purple', value: '#800080', distance: 6 },\n * // ...]\n * ```\n *\n * Defaults: palette = `web`, format = 'HEX', `k` = undefined (strict).\n */\n\n// Overload 1: strict — single ColorValue or null (unchanged).\nexport function resolve(\n name: string,\n opts?: { palette?: Palette; format?: ColorFormat },\n): ColorValue | null;\n\n// Overload 2: fuzzy top-k — ranked Match[].\nexport function resolve<P extends Palette = typeof web>(\n name: string,\n opts: { palette?: P; format?: ColorFormat; k: number },\n): Array<ResolveMatch<PaletteKey<P>>>;\n\n// Implementation.\nexport function resolve(\n name: string,\n opts: { palette?: Palette; format?: ColorFormat; k?: number } = {},\n): ColorValue | null | Array<ResolveMatch<string>> {\n const palette = opts.palette ?? web;\n const format = opts.format ?? 'HEX';\n const normalized = palette.normalize(name);\n\n if (opts.k !== undefined) {\n const limit = Math.max(0, opts.k);\n if (limit === 0) return [];\n if (normalized.length > MAX_FUZZY_INPUT_LENGTH) return [];\n // Iterate the name index's normalized → canonical map once; for each\n // entry compute Levenshtein from the user's normalized input.\n const ranked: Array<[string, number]> = [];\n for (const [normalizedKey, canonical] of getNameIndex(palette).entries()) {\n ranked.push([canonical, levenshtein(normalized, normalizedKey)]);\n }\n ranked.sort((a, b) => a[1] - b[1]);\n const out: Array<ResolveMatch<string>> = [];\n const take = Math.min(limit, ranked.length);\n for (let i = 0; i < take; i++) {\n const entry = ranked[i];\n if (entry === undefined) continue;\n const hex = (palette.colors as Record<string, HexColor>)[entry[0]];\n if (hex === undefined) continue;\n out.push({\n name: entry[0],\n value: fromRgba(hexToRgba(hex), format),\n distance: entry[1],\n });\n }\n return out;\n }\n\n // Strict path.\n const canonical = getNameIndex(palette).get(normalized);\n if (canonical === undefined) return null;\n const hex = (palette.colors as Record<string, HexColor>)[canonical];\n if (hex === undefined) return null;\n return fromRgba(hexToRgba(hex), format);\n}\n"]}
|
package/dist/resolve.js
CHANGED
|
@@ -1,27 +1,54 @@
|
|
|
1
1
|
import { hexToRgba } from './conversions/hex.js';
|
|
2
2
|
import { fromRgba } from './convert.js';
|
|
3
3
|
import { getNameIndex } from './indexing.js';
|
|
4
|
+
import { levenshtein } from './math/editDistance.js';
|
|
4
5
|
import { web } from './palettes/web.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* Defaults: palette = `web`, format = 'HEX'.
|
|
11
|
-
*
|
|
12
|
-
* BYO palettes: pass any object matching `Palette<Name>` — no registration
|
|
13
|
-
* needed; the palette's normalizer handles lookup.
|
|
14
|
-
*/
|
|
6
|
+
// No built-in palette key exceeds ~30 chars post-normalize; anything well past
|
|
7
|
+
// that can't plausibly win a fuzzy match and risks pathological O(n·m) cost
|
|
8
|
+
// across every palette entry. Guard the k-branch input at 64.
|
|
9
|
+
const MAX_FUZZY_INPUT_LENGTH = 64;
|
|
10
|
+
// Implementation.
|
|
15
11
|
export function resolve(name, opts = {}) {
|
|
16
12
|
const palette = opts.palette ?? web;
|
|
17
13
|
const format = opts.format ?? 'HEX';
|
|
18
|
-
const
|
|
14
|
+
const normalized = palette.normalize(name);
|
|
15
|
+
if (opts.k !== undefined) {
|
|
16
|
+
const limit = Math.max(0, opts.k);
|
|
17
|
+
if (limit === 0)
|
|
18
|
+
return [];
|
|
19
|
+
if (normalized.length > MAX_FUZZY_INPUT_LENGTH)
|
|
20
|
+
return [];
|
|
21
|
+
// Iterate the name index's normalized → canonical map once; for each
|
|
22
|
+
// entry compute Levenshtein from the user's normalized input.
|
|
23
|
+
const ranked = [];
|
|
24
|
+
for (const [normalizedKey, canonical] of getNameIndex(palette).entries()) {
|
|
25
|
+
ranked.push([canonical, levenshtein(normalized, normalizedKey)]);
|
|
26
|
+
}
|
|
27
|
+
ranked.sort((a, b) => a[1] - b[1]);
|
|
28
|
+
const out = [];
|
|
29
|
+
const take = Math.min(limit, ranked.length);
|
|
30
|
+
for (let i = 0; i < take; i++) {
|
|
31
|
+
const entry = ranked[i];
|
|
32
|
+
if (entry === undefined)
|
|
33
|
+
continue;
|
|
34
|
+
const hex = palette.colors[entry[0]];
|
|
35
|
+
if (hex === undefined)
|
|
36
|
+
continue;
|
|
37
|
+
out.push({
|
|
38
|
+
name: entry[0],
|
|
39
|
+
value: fromRgba(hexToRgba(hex), format),
|
|
40
|
+
distance: entry[1],
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
// Strict path.
|
|
46
|
+
const canonical = getNameIndex(palette).get(normalized);
|
|
19
47
|
if (canonical === undefined)
|
|
20
48
|
return null;
|
|
21
49
|
const hex = palette.colors[canonical];
|
|
22
50
|
if (hex === undefined)
|
|
23
51
|
return null;
|
|
24
|
-
// Skip detectFormat — we already know this is HEX (read from palette data).
|
|
25
52
|
return fromRgba(hexToRgba(hex), format);
|
|
26
53
|
}
|
|
27
54
|
//# sourceMappingURL=resolve.js.map
|
package/dist/resolve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,+EAA+E;AAC/E,4EAA4E;AAC5E,8DAA8D;AAC9D,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAqDlC,kBAA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IAAI,KAAK,KAAK,SAAS;gBAAE,SAAS;YAClC,MAAM,GAAG,GAAI,OAAO,CAAC,MAAmC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACnE,IAAI,GAAG,KAAK,SAAS;gBAAE,SAAS;YAChC,GAAG,CAAC,IAAI,CAAC;gBACP,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;gBACvC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;aACnB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,eAAe;IACf,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxD,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACzC,MAAM,GAAG,GAAI,OAAO,CAAC,MAAmC,CAAC,SAAS,CAAC,CAAC;IACpE,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { hexToRgba } from './conversions/hex.js';\nimport { fromRgba } from './convert.js';\nimport { getNameIndex } from './indexing.js';\nimport { levenshtein } from './math/editDistance.js';\nimport { web } from './palettes/web.js';\nimport type { ColorFormat, ColorValue, HexColor, Palette } from './types.js';\n\n// No built-in palette key exceeds ~30 chars post-normalize; anything well past\n// that can't plausibly win a fuzzy match and risks pathological O(n·m) cost\n// across every palette entry. Guard the k-branch input at 64.\nconst MAX_FUZZY_INPUT_LENGTH = 64;\n\n/** Extract string keys from a Palette's `colors` map. */\ntype PaletteKey<P extends Palette> = Extract<keyof P['colors'], string>;\n\n/**\n * One ranked fuzzy-match entry when `resolve` is called with `k`.\n * `distance` is the Levenshtein edit distance between the normalized\n * input and the normalized palette key — integer count of insertions,\n * deletions, and substitutions.\n */\nexport type ResolveMatch<Name extends string> = {\n readonly name: Name;\n readonly value: ColorValue;\n readonly distance: number;\n};\n\n/**\n * Resolve a human-readable name to a color. Normalizes the input using\n * the palette's own `normalize` function before looking it up.\n *\n * **Without `k`** (strict, unchanged): returns the exact match value, or\n * `null` if the normalized name isn't in the palette.\n *\n * **With `k`** (fuzzy, typo-tolerant): returns an array of the top `k`\n * matches ranked by Levenshtein edit distance against normalized keys.\n * Useful for user-typed input where misspellings, casing, and\n * punctuation can all be recovered.\n *\n * ```ts\n * resolve('rebeccapurple') // '#663399'\n * resolve('rebecapurple') // null (strict)\n * resolve('rebecapurple', { palette: web, k: 3 }) // fuzzy:\n * // [{ name: 'rebeccapurple', value: '#663399', distance: 1 },\n * // { name: 'purple', value: '#800080', distance: 6 },\n * // ...]\n * ```\n *\n * Defaults: palette = `web`, format = 'HEX', `k` = undefined (strict).\n */\n\n// Overload 1: strict — single ColorValue or null (unchanged).\nexport function resolve(\n name: string,\n opts?: { palette?: Palette; format?: ColorFormat },\n): ColorValue | null;\n\n// Overload 2: fuzzy top-k — ranked Match[].\nexport function resolve<P extends Palette = typeof web>(\n name: string,\n opts: { palette?: P; format?: ColorFormat; k: number },\n): Array<ResolveMatch<PaletteKey<P>>>;\n\n// Implementation.\nexport function resolve(\n name: string,\n opts: { palette?: Palette; format?: ColorFormat; k?: number } = {},\n): ColorValue | null | Array<ResolveMatch<string>> {\n const palette = opts.palette ?? web;\n const format = opts.format ?? 'HEX';\n const normalized = palette.normalize(name);\n\n if (opts.k !== undefined) {\n const limit = Math.max(0, opts.k);\n if (limit === 0) return [];\n if (normalized.length > MAX_FUZZY_INPUT_LENGTH) return [];\n // Iterate the name index's normalized → canonical map once; for each\n // entry compute Levenshtein from the user's normalized input.\n const ranked: Array<[string, number]> = [];\n for (const [normalizedKey, canonical] of getNameIndex(palette).entries()) {\n ranked.push([canonical, levenshtein(normalized, normalizedKey)]);\n }\n ranked.sort((a, b) => a[1] - b[1]);\n const out: Array<ResolveMatch<string>> = [];\n const take = Math.min(limit, ranked.length);\n for (let i = 0; i < take; i++) {\n const entry = ranked[i];\n if (entry === undefined) continue;\n const hex = (palette.colors as Record<string, HexColor>)[entry[0]];\n if (hex === undefined) continue;\n out.push({\n name: entry[0],\n value: fromRgba(hexToRgba(hex), format),\n distance: entry[1],\n });\n }\n return out;\n }\n\n // Strict path.\n const canonical = getNameIndex(palette).get(normalized);\n if (canonical === undefined) return null;\n const hex = (palette.colors as Record<string, HexColor>)[canonical];\n if (hex === undefined) return null;\n return fromRgba(hexToRgba(hex), format);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chromonym",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "One color-naming API for any palette. Identify, resolve, and convert colors across your own palette or the built-in CSS, X11, and
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "One color-naming API for any palette. Identify, resolve, and convert colors across your own palette or the built-in CSS, X11, Pantone, and Crayola sets — fully typed, tree-shakeable, perceptual distance metrics (CIEDE2000 / OKLAB).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"color",
|
|
7
7
|
"color-name",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"css-colors",
|
|
14
14
|
"x11-colors",
|
|
15
15
|
"pantone",
|
|
16
|
+
"crayola",
|
|
16
17
|
"deltaE",
|
|
17
18
|
"ciede2000",
|
|
18
19
|
"lab",
|
|
@@ -64,6 +65,11 @@
|
|
|
64
65
|
"import": "./dist/palettes/pantone.js",
|
|
65
66
|
"default": "./dist/palettes/pantone.js"
|
|
66
67
|
},
|
|
68
|
+
"./crayola": {
|
|
69
|
+
"types": "./dist/palettes/crayola.d.ts",
|
|
70
|
+
"import": "./dist/palettes/crayola.js",
|
|
71
|
+
"default": "./dist/palettes/crayola.js"
|
|
72
|
+
},
|
|
67
73
|
"./conversions/hex": {
|
|
68
74
|
"types": "./dist/conversions/hex.d.ts",
|
|
69
75
|
"import": "./dist/conversions/hex.js",
|
|
@@ -120,16 +126,19 @@
|
|
|
120
126
|
"lint:fix": "biome check --write",
|
|
121
127
|
"format": "biome format --write .",
|
|
122
128
|
"test": "bun test",
|
|
129
|
+
"check:package": "publint && attw --pack --profile esm-only",
|
|
130
|
+
"check:knip": "knip",
|
|
123
131
|
"demo": "bun run build && cd demo && bun run dev",
|
|
124
|
-
"prepublishOnly": "bun run build"
|
|
132
|
+
"prepublishOnly": "bun run build && bun run check:package"
|
|
125
133
|
},
|
|
126
134
|
"devDependencies": {
|
|
135
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
127
136
|
"@biomejs/biome": "^2.2.0",
|
|
128
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
129
|
-
"@semantic-release/git": "^10.0.1",
|
|
130
137
|
"@semantic-release/npm": "^13.1.5",
|
|
131
138
|
"@types/bun": "^1.3.12",
|
|
132
139
|
"@typescript/native-preview": "7.0.0-dev.20260417.1",
|
|
140
|
+
"knip": "^6.5.0",
|
|
141
|
+
"publint": "^0.3.18",
|
|
133
142
|
"semantic-release": "^25.0.3"
|
|
134
143
|
},
|
|
135
144
|
"publishConfig": {
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { hexToRgba, rgbaToHex } from './hex.js';
|
|
2
|
-
export { hslToRgba, rgbaToHsl } from './hsl.js';
|
|
3
|
-
export { hsvToRgba, rgbaToHsv } from './hsv.js';
|
|
4
|
-
export { pantoneToRgba, rgbaToPantone } from './pantone.js';
|
|
5
|
-
export { rgbaToRgb, rgbToRgba } from './rgb.js';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { hexToRgba, rgbaToHex } from './hex.js';\nexport { hslToRgba, rgbaToHsl } from './hsl.js';\nexport { hsvToRgba, rgbaToHsv } from './hsv.js';\nexport { pantoneToRgba, rgbaToPantone } from './pantone.js';\nexport { rgbaToRgb, rgbToRgba } from './rgb.js';\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { hexToRgba, rgbaToHex } from './hex.js';
|
|
2
|
-
export { hslToRgba, rgbaToHsl } from './hsl.js';
|
|
3
|
-
export { hsvToRgba, rgbaToHsv } from './hsv.js';
|
|
4
|
-
export { pantoneToRgba, rgbaToPantone } from './pantone.js';
|
|
5
|
-
export { rgbaToRgb, rgbToRgba } from './rgb.js';
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/conversions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { hexToRgba, rgbaToHex } from './hex.js';\nexport { hslToRgba, rgbaToHsl } from './hsl.js';\nexport { hsvToRgba, rgbaToHsv } from './hsv.js';\nexport { pantoneToRgba, rgbaToPantone } from './pantone.js';\nexport { rgbaToRgb, rgbToRgba } from './rgb.js';\n"]}
|
package/dist/palettes/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/palettes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,KAAK,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,KAAK,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { type PantoneColorName, pantone } from './pantone.js';\nexport { type WebColorName, web } from './web.js';\nexport { type X11ColorName, x11 } from './x11.js';\n"]}
|
package/dist/palettes/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/palettes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAqB,GAAG,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAqB,GAAG,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { type PantoneColorName, pantone } from './pantone.js';\nexport { type WebColorName, web } from './web.js';\nexport { type X11ColorName, x11 } from './x11.js';\n"]}
|