chromonym 1.4.1 → 3.0.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 +64 -4
- package/README.md +290 -83
- package/dist/conversions/hex.d.ts +1 -1
- package/dist/conversions/hex.d.ts.map +1 -1
- package/dist/conversions/hex.js +2 -2
- package/dist/conversions/hex.js.map +1 -1
- package/dist/conversions/hsl.d.ts +1 -1
- package/dist/conversions/hsl.d.ts.map +1 -1
- package/dist/conversions/hsl.js +2 -2
- package/dist/conversions/hsl.js.map +1 -1
- package/dist/conversions/hsv.d.ts +1 -1
- package/dist/conversions/hsv.d.ts.map +1 -1
- package/dist/conversions/hsv.js +2 -2
- package/dist/conversions/hsv.js.map +1 -1
- package/dist/conversions/index.d.ts +5 -5
- package/dist/conversions/index.d.ts.map +1 -1
- package/dist/conversions/index.js +5 -5
- package/dist/conversions/index.js.map +1 -1
- package/dist/conversions/pantone.d.ts +9 -7
- package/dist/conversions/pantone.d.ts.map +1 -1
- package/dist/conversions/pantone.js +11 -10
- package/dist/conversions/pantone.js.map +1 -1
- package/dist/conversions/rgb.d.ts +1 -1
- package/dist/conversions/rgb.d.ts.map +1 -1
- package/dist/conversions/rgb.js +1 -1
- package/dist/conversions/rgb.js.map +1 -1
- package/dist/convert.d.ts +45 -5
- package/dist/convert.d.ts.map +1 -1
- package/dist/convert.js +68 -17
- package/dist/convert.js.map +1 -1
- package/dist/detectFormat.d.ts +1 -1
- package/dist/detectFormat.d.ts.map +1 -1
- package/dist/detectFormat.js +2 -6
- package/dist/detectFormat.js.map +1 -1
- package/dist/identify.d.ts +41 -19
- package/dist/identify.d.ts.map +1 -1
- package/dist/identify.js +37 -22
- package/dist/identify.js.map +1 -1
- package/dist/index.d.ts +15 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/indexing.d.ts +48 -24
- package/dist/indexing.d.ts.map +1 -1
- package/dist/indexing.js +111 -22
- package/dist/indexing.js.map +1 -1
- package/dist/math/clamp.d.ts.map +1 -1
- package/dist/math/clamp.js.map +1 -1
- package/dist/math/colorSpace.d.ts +1 -1
- package/dist/math/colorSpace.d.ts.map +1 -1
- package/dist/math/colorSpace.js.map +1 -1
- package/dist/math/deltaE.d.ts.map +1 -1
- package/dist/math/deltaE.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/math/euclideanDistance.d.ts +1 -1
- package/dist/math/euclideanDistance.d.ts.map +1 -1
- package/dist/math/euclideanDistance.js.map +1 -1
- package/dist/math/hueSector.d.ts.map +1 -1
- package/dist/math/hueSector.js.map +1 -1
- 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/palettes/index.d.ts +5 -0
- package/dist/palettes/index.d.ts.map +1 -0
- package/dist/palettes/index.js +5 -0
- package/dist/palettes/index.js.map +1 -0
- package/dist/palettes/normalize.d.ts +17 -0
- package/dist/palettes/normalize.d.ts.map +1 -0
- package/dist/palettes/normalize.js +19 -0
- package/dist/palettes/normalize.js.map +1 -0
- package/dist/palettes/pantone.d.ts +1834 -0
- package/dist/palettes/pantone.d.ts.map +1 -0
- package/dist/palettes/pantone.js +925 -0
- package/dist/palettes/pantone.js.map +1 -0
- package/dist/palettes/web.d.ts +320 -0
- package/dist/palettes/web.d.ts.map +1 -0
- package/dist/{colorspaces → palettes}/web.js +18 -3
- package/dist/palettes/web.js.map +1 -0
- package/dist/palettes/x11.d.ts +1346 -0
- package/dist/palettes/x11.d.ts.map +1 -0
- package/dist/palettes/x11.js +686 -0
- package/dist/palettes/x11.js.map +1 -0
- package/dist/resolve.d.ts +42 -7
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +48 -20
- package/dist/resolve.js.map +1 -1
- package/dist/types.d.ts +10 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -1
- package/dist/types.js.map +1 -1
- package/package.json +38 -18
- package/dist/colorspaces/index.d.ts +0 -4
- package/dist/colorspaces/index.d.ts.map +0 -1
- package/dist/colorspaces/index.js +0 -4
- package/dist/colorspaces/index.js.map +0 -1
- package/dist/colorspaces/pantone.d.ts +0 -919
- package/dist/colorspaces/pantone.d.ts.map +0 -1
- package/dist/colorspaces/pantone.js +0 -918
- package/dist/colorspaces/pantone.js.map +0 -1
- package/dist/colorspaces/registry.d.ts +0 -26
- package/dist/colorspaces/registry.d.ts.map +0 -1
- package/dist/colorspaces/registry.js +0 -36
- package/dist/colorspaces/registry.js.map +0 -1
- package/dist/colorspaces/web.d.ts +0 -156
- package/dist/colorspaces/web.d.ts.map +0 -1
- package/dist/colorspaces/web.js.map +0 -1
- package/dist/colorspaces/x11.d.ts +0 -667
- package/dist/colorspaces/x11.d.ts.map +0 -1
- package/dist/colorspaces/x11.js +0 -666
- package/dist/colorspaces/x11.js.map +0 -1
|
@@ -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":"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","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 @@
|
|
|
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,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 CrayolaColorName, crayola } from './crayola.js';\nexport { type PantoneColorName, pantone } from './pantone.js';\nexport { type WebColorName, web } from './web.js';\nexport { type X11ColorName, x11 } from './x11.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/palettes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,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 CrayolaColorName, crayola } from './crayola.js';\nexport { type PantoneColorName, pantone } from './pantone.js';\nexport { type WebColorName, web } from './web.js';\nexport { type X11ColorName, x11 } from './x11.js';\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NormalizeFn } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Name normalizers used by palettes.
|
|
4
|
+
*
|
|
5
|
+
* Tree-shake note: this module has zero imports beyond a type. Palette
|
|
6
|
+
* modules (`web`, `x11`, `pantone`, or user BYO palettes) can reference
|
|
7
|
+
* these without dragging in the full `indexing.ts` graph, which pulls
|
|
8
|
+
* math modules needed only when `identify` / `resolve` actually runs.
|
|
9
|
+
*/
|
|
10
|
+
/** Lowercase + strip non-alphanumeric. Works for web, x11, and most BYO. */
|
|
11
|
+
export declare const standardNormalize: NormalizeFn;
|
|
12
|
+
/**
|
|
13
|
+
* Pantone: also strip a leading "Pantone" or "PMS" prefix so that
|
|
14
|
+
* "185 C", "185c", "Pantone 185 C", "PMS185C" all map to "185c".
|
|
15
|
+
*/
|
|
16
|
+
export declare const pantoneNormalize: NormalizeFn;
|
|
17
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/palettes/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;GAOG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,EAAE,WAA8D,CAAC;AAE/F;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAID,CAAC","sourcesContent":["import type { NormalizeFn } from '../types.js';\n\n/**\n * Name normalizers used by palettes.\n *\n * Tree-shake note: this module has zero imports beyond a type. Palette\n * modules (`web`, `x11`, `pantone`, or user BYO palettes) can reference\n * these without dragging in the full `indexing.ts` graph, which pulls\n * math modules needed only when `identify` / `resolve` actually runs.\n */\n\n/** Lowercase + strip non-alphanumeric. Works for web, x11, and most BYO. */\nexport const standardNormalize: NormalizeFn = (s) => s.toLowerCase().replace(/[^a-z0-9]/g, '');\n\n/**\n * Pantone: also strip a leading \"Pantone\" or \"PMS\" prefix so that\n * \"185 C\", \"185c\", \"Pantone 185 C\", \"PMS185C\" all map to \"185c\".\n */\nexport const pantoneNormalize: NormalizeFn = (s) =>\n s\n .toLowerCase()\n .replace(/^(pantone|pms)\\s*/, '')\n .replace(/[^a-z0-9]/g, '');\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name normalizers used by palettes.
|
|
3
|
+
*
|
|
4
|
+
* Tree-shake note: this module has zero imports beyond a type. Palette
|
|
5
|
+
* modules (`web`, `x11`, `pantone`, or user BYO palettes) can reference
|
|
6
|
+
* these without dragging in the full `indexing.ts` graph, which pulls
|
|
7
|
+
* math modules needed only when `identify` / `resolve` actually runs.
|
|
8
|
+
*/
|
|
9
|
+
/** Lowercase + strip non-alphanumeric. Works for web, x11, and most BYO. */
|
|
10
|
+
export const standardNormalize = (s) => s.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
11
|
+
/**
|
|
12
|
+
* Pantone: also strip a leading "Pantone" or "PMS" prefix so that
|
|
13
|
+
* "185 C", "185c", "Pantone 185 C", "PMS185C" all map to "185c".
|
|
14
|
+
*/
|
|
15
|
+
export const pantoneNormalize = (s) => s
|
|
16
|
+
.toLowerCase()
|
|
17
|
+
.replace(/^(pantone|pms)\s*/, '')
|
|
18
|
+
.replace(/[^a-z0-9]/g, '');
|
|
19
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../src/palettes/normalize.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAE/F;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAgB,CAAC,CAAC,EAAE,EAAE,CACjD,CAAC;KACE,WAAW,EAAE;KACb,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;KAChC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC","sourcesContent":["import type { NormalizeFn } from '../types.js';\n\n/**\n * Name normalizers used by palettes.\n *\n * Tree-shake note: this module has zero imports beyond a type. Palette\n * modules (`web`, `x11`, `pantone`, or user BYO palettes) can reference\n * these without dragging in the full `indexing.ts` graph, which pulls\n * math modules needed only when `identify` / `resolve` actually runs.\n */\n\n/** Lowercase + strip non-alphanumeric. Works for web, x11, and most BYO. */\nexport const standardNormalize: NormalizeFn = (s) => s.toLowerCase().replace(/[^a-z0-9]/g, '');\n\n/**\n * Pantone: also strip a leading \"Pantone\" or \"PMS\" prefix so that\n * \"185 C\", \"185c\", \"Pantone 185 C\", \"PMS185C\" all map to \"185c\".\n */\nexport const pantoneNormalize: NormalizeFn = (s) =>\n s\n .toLowerCase()\n .replace(/^(pantone|pms)\\s*/, '')\n .replace(/[^a-z0-9]/g, '');\n"]}
|