chromonym 1.1.0 → 1.3.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 +39 -0
- package/README.md +93 -8
- package/dist/colorspaces/registry.d.ts +26 -0
- package/dist/colorspaces/registry.d.ts.map +1 -0
- package/dist/colorspaces/registry.js +36 -0
- package/dist/colorspaces/registry.js.map +1 -0
- package/dist/conversions/hex.d.ts.map +1 -1
- package/dist/conversions/hex.js +6 -5
- package/dist/conversions/hex.js.map +1 -1
- package/dist/conversions/hsl.d.ts.map +1 -1
- package/dist/conversions/hsl.js +34 -52
- package/dist/conversions/hsl.js.map +1 -1
- package/dist/conversions/hsv.d.ts.map +1 -1
- package/dist/conversions/hsv.js +30 -48
- package/dist/conversions/hsv.js.map +1 -1
- package/dist/conversions/pantone.d.ts +5 -2
- package/dist/conversions/pantone.d.ts.map +1 -1
- package/dist/conversions/pantone.js +8 -44
- package/dist/conversions/pantone.js.map +1 -1
- package/dist/conversions/rgb.d.ts +4 -2
- package/dist/conversions/rgb.d.ts.map +1 -1
- package/dist/conversions/rgb.js +28 -17
- package/dist/conversions/rgb.js.map +1 -1
- package/dist/convert.d.ts +12 -1
- package/dist/convert.d.ts.map +1 -1
- package/dist/convert.js +24 -6
- package/dist/convert.js.map +1 -1
- package/dist/detectFormat.d.ts +8 -0
- package/dist/detectFormat.d.ts.map +1 -1
- package/dist/detectFormat.js +17 -5
- package/dist/detectFormat.js.map +1 -1
- package/dist/identify.d.ts +13 -5
- package/dist/identify.d.ts.map +1 -1
- package/dist/identify.js +20 -35
- package/dist/identify.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/indexing.d.ts +44 -0
- package/dist/indexing.d.ts.map +1 -0
- package/dist/indexing.js +140 -0
- package/dist/indexing.js.map +1 -0
- package/dist/math/clamp.d.ts +11 -0
- package/dist/math/clamp.d.ts.map +1 -0
- package/dist/math/clamp.js +18 -0
- package/dist/math/clamp.js.map +1 -0
- package/dist/math/colorSpace.d.ts +55 -0
- package/dist/math/colorSpace.d.ts.map +1 -0
- package/dist/math/colorSpace.js +111 -0
- package/dist/math/colorSpace.js.map +1 -0
- package/dist/math/deltaE.d.ts +52 -0
- package/dist/math/deltaE.d.ts.map +1 -0
- package/dist/math/deltaE.js +190 -0
- package/dist/math/deltaE.js.map +1 -0
- package/dist/math/euclideanDistance.d.ts +7 -0
- package/dist/math/euclideanDistance.d.ts.map +1 -1
- package/dist/math/euclideanDistance.js +13 -4
- package/dist/math/euclideanDistance.js.map +1 -1
- package/dist/math/hueSector.d.ts +15 -0
- package/dist/math/hueSector.d.ts.map +1 -0
- package/dist/math/hueSector.js +27 -0
- package/dist/math/hueSector.js.map +1 -0
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +11 -34
- package/dist/resolve.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +72 -8
- package/dist/math/index.d.ts +0 -2
- package/dist/math/index.d.ts.map +0 -1
- package/dist/math/index.js +0 -4
- package/dist/math/index.js.map +0 -1
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Squared Euclidean distance between two colors in RGB space.
|
|
3
|
+
* Alpha channel is ignored. Faster than `euclideanDistance` — use this
|
|
4
|
+
* when you only need to compare or minimize (sqrt is monotonic, so
|
|
5
|
+
* argmin(d) === argmin(d²)).
|
|
6
|
+
*/
|
|
7
|
+
export function squaredDistanceRgb(a, b) {
|
|
8
|
+
const dr = a.r - b.r;
|
|
9
|
+
const dg = a.g - b.g;
|
|
10
|
+
const db = a.b - b.b;
|
|
11
|
+
return dr * dr + dg * dg + db * db;
|
|
12
|
+
}
|
|
1
13
|
/**
|
|
2
14
|
* Euclidean distance between two colors in RGB space.
|
|
3
15
|
* Alpha channel is ignored (matches classic `detect-color` behavior).
|
|
@@ -5,9 +17,6 @@
|
|
|
5
17
|
* where perceptual uniformity matters.
|
|
6
18
|
*/
|
|
7
19
|
export function euclideanDistance(a, b) {
|
|
8
|
-
|
|
9
|
-
const dg = a.g - b.g;
|
|
10
|
-
const db = a.b - b.b;
|
|
11
|
-
return Math.sqrt(dr * dr + dg * dg + db * db);
|
|
20
|
+
return Math.sqrt(squaredDistanceRgb(a, b));
|
|
12
21
|
}
|
|
13
22
|
//# sourceMappingURL=euclideanDistance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"euclideanDistance.js","sourceRoot":"","sources":["../../src/math/euclideanDistance.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"euclideanDistance.js","sourceRoot":"","sources":["../../src/math/euclideanDistance.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,CAAO,EAAE,CAAO;IACjD,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAO,EAAE,CAAO;IAChD,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map a normalized hue sector value (range [0, 6)) plus chroma and its
|
|
3
|
+
* secondary into the primary-color tuple `[r', g', b']` used by the
|
|
4
|
+
* standard HSL→RGB and HSV→RGB algorithms. Each component is in [0, chroma].
|
|
5
|
+
*
|
|
6
|
+
* Shared by `hslToRgba` and `hsvToRgba`: same six-sector table, different
|
|
7
|
+
* formulas for chroma and the offset. The caller adds the offset and
|
|
8
|
+
* scales by 255.
|
|
9
|
+
*
|
|
10
|
+
* hueSector = h / 60 (h wrapped to [0, 360))
|
|
11
|
+
* chroma = HSL: (1 − |2l − 1|)·s ; HSV: v·s
|
|
12
|
+
* secondary = chroma · (1 − |hueSector mod 2 − 1|)
|
|
13
|
+
*/
|
|
14
|
+
export declare function hueSectorToPrime(hueSector: number, chroma: number, secondary: number): [number, number, number];
|
|
15
|
+
//# sourceMappingURL=hueSector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hueSector.d.ts","sourceRoot":"","sources":["../../src/math/hueSector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAO1B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map a normalized hue sector value (range [0, 6)) plus chroma and its
|
|
3
|
+
* secondary into the primary-color tuple `[r', g', b']` used by the
|
|
4
|
+
* standard HSL→RGB and HSV→RGB algorithms. Each component is in [0, chroma].
|
|
5
|
+
*
|
|
6
|
+
* Shared by `hslToRgba` and `hsvToRgba`: same six-sector table, different
|
|
7
|
+
* formulas for chroma and the offset. The caller adds the offset and
|
|
8
|
+
* scales by 255.
|
|
9
|
+
*
|
|
10
|
+
* hueSector = h / 60 (h wrapped to [0, 360))
|
|
11
|
+
* chroma = HSL: (1 − |2l − 1|)·s ; HSV: v·s
|
|
12
|
+
* secondary = chroma · (1 − |hueSector mod 2 − 1|)
|
|
13
|
+
*/
|
|
14
|
+
export function hueSectorToPrime(hueSector, chroma, secondary) {
|
|
15
|
+
if (hueSector < 1)
|
|
16
|
+
return [chroma, secondary, 0];
|
|
17
|
+
if (hueSector < 2)
|
|
18
|
+
return [secondary, chroma, 0];
|
|
19
|
+
if (hueSector < 3)
|
|
20
|
+
return [0, chroma, secondary];
|
|
21
|
+
if (hueSector < 4)
|
|
22
|
+
return [0, secondary, chroma];
|
|
23
|
+
if (hueSector < 5)
|
|
24
|
+
return [secondary, 0, chroma];
|
|
25
|
+
return [chroma, 0, secondary];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=hueSector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hueSector.js","sourceRoot":"","sources":["../../src/math/hueSector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,MAAc,EACd,SAAiB;IAEjB,IAAI,SAAS,GAAG,CAAC;QAAE,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACjD,IAAI,SAAS,GAAG,CAAC;QAAE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACjD,IAAI,SAAS,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACjD,IAAI,SAAS,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACjD,IAAI,SAAS,GAAG,CAAC;QAAE,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IACjD,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;AAChC,CAAC"}
|
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,
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAY,MAAM,SAAS,CAAC;AAEjF;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,cAAc,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GAC/D,UAAU,GAAG,IAAI,CAUnB"}
|
package/dist/resolve.js
CHANGED
|
@@ -1,33 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const COLORSPACES = { web, x11, pantone };
|
|
6
|
-
function normalize(s) {
|
|
7
|
-
return s.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
8
|
-
}
|
|
9
|
-
// Pantone-specific: also strip leading "Pantone" / "PMS" prefix so that
|
|
10
|
-
// "Pantone 185 C" and "PMS 185C" both resolve to "185C".
|
|
11
|
-
function normalizeForPantone(s) {
|
|
12
|
-
return s
|
|
13
|
-
.toLowerCase()
|
|
14
|
-
.replace(/^(pantone|pms)\s*/, '')
|
|
15
|
-
.replace(/[^a-z0-9]/g, '');
|
|
16
|
-
}
|
|
17
|
-
const indexes = new Map();
|
|
18
|
-
function getIndex(colorspace) {
|
|
19
|
-
let idx = indexes.get(colorspace);
|
|
20
|
-
if (idx === undefined) {
|
|
21
|
-
idx = new Map();
|
|
22
|
-
const space = COLORSPACES[colorspace];
|
|
23
|
-
const normFn = colorspace === 'pantone' ? normalizeForPantone : normalize;
|
|
24
|
-
for (const key of Object.keys(space)) {
|
|
25
|
-
idx.set(normFn(key), key);
|
|
26
|
-
}
|
|
27
|
-
indexes.set(colorspace, idx);
|
|
28
|
-
}
|
|
29
|
-
return idx;
|
|
30
|
-
}
|
|
1
|
+
import { COLORSPACE_NAMES, COLORSPACES, NORMALIZERS } from './colorspaces/registry';
|
|
2
|
+
import { hexToRgba } from './conversions/hex';
|
|
3
|
+
import { fromRgba } from './convert';
|
|
4
|
+
import { getNameIndex } from './indexing';
|
|
31
5
|
/**
|
|
32
6
|
* Resolve a human-readable name to a color. Normalizes the input
|
|
33
7
|
* (lowercases, strips non-alphanumeric characters, and for the pantone
|
|
@@ -38,12 +12,15 @@ function getIndex(colorspace) {
|
|
|
38
12
|
*/
|
|
39
13
|
export function resolve(name, opts = {}) {
|
|
40
14
|
const { colorspace = 'web', format = 'HEX' } = opts;
|
|
41
|
-
|
|
42
|
-
const canonical = getIndex(colorspace).get(normFn(name));
|
|
43
|
-
if (canonical === undefined)
|
|
15
|
+
if (!COLORSPACE_NAMES.has(colorspace))
|
|
44
16
|
return null;
|
|
45
17
|
const space = COLORSPACES[colorspace];
|
|
18
|
+
const normalize = NORMALIZERS[colorspace];
|
|
19
|
+
const canonical = getNameIndex(space, normalize).get(normalize(name));
|
|
20
|
+
if (canonical === undefined)
|
|
21
|
+
return null;
|
|
46
22
|
const hex = space[canonical];
|
|
47
|
-
|
|
23
|
+
// Skip detectFormat — we already know this is HEX (read from colorspace data).
|
|
24
|
+
return fromRgba(hexToRgba(hex), format);
|
|
48
25
|
}
|
|
49
26
|
//# 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,
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CACrB,IAAY,EACZ,IAAI,GAA0D,EAAE;IAEhE,MAAM,EAAE,UAAU,GAAG,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC;IACpD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IACnD,MAAM,KAAK,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACtE,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACzC,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAa,CAAC;IACzC,+EAA+E;IAC/E,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -38,5 +38,6 @@ export declare const COLOR_FORMATS: ReadonlySet<ColorFormat>;
|
|
|
38
38
|
export type ColorValue = HexColor | RgbString | Rgba | HslString | HsvString | PantoneCode;
|
|
39
39
|
export type Colorspace = Record<string, HexColor>;
|
|
40
40
|
export type ColorspaceName = 'web' | 'x11' | 'pantone';
|
|
41
|
+
export type DistanceMetric = 'euclidean-srgb' | 'euclidean-linear' | 'deltaE76' | 'deltaE94' | 'deltaE2000' | 'deltaEok';
|
|
41
42
|
export {};
|
|
42
43
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,QAAQ,GAAG,IAA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M,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5D,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAI7C,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAGjC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAG7F,QAAA,MAAM,aAAa,YAAI,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAU,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AACzD,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,WAAW,CAA0B,CAAC;AAG9E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAG3F,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAClD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC;AAWvD,MAAM,MAAM,cAAc,GACtB,gBAAgB,GAChB,kBAAkB,GAClB,UAAU,GACV,UAAU,GACV,YAAY,GACZ,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chromonym",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Tree-shakeable color-naming primitive for TypeScript. Identify, resolve, and convert colors across CSS, X11, and Pantone colorspaces — with perceptual distance metrics (CIEDE2000).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"color",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"color-name",
|
|
8
|
+
"color-naming",
|
|
9
|
+
"color-identify",
|
|
10
|
+
"color-resolve",
|
|
11
|
+
"color-convert",
|
|
12
|
+
"nearest-color",
|
|
13
|
+
"css-colors",
|
|
14
|
+
"x11-colors",
|
|
15
|
+
"pantone",
|
|
16
|
+
"deltaE",
|
|
17
|
+
"ciede2000",
|
|
18
|
+
"lab",
|
|
19
|
+
"oklab",
|
|
20
|
+
"perceptual",
|
|
21
|
+
"typescript",
|
|
22
|
+
"tree-shakeable",
|
|
23
|
+
"tree-shaking",
|
|
9
24
|
"hex",
|
|
25
|
+
"rgb",
|
|
26
|
+
"hsl",
|
|
27
|
+
"hsv",
|
|
10
28
|
"palette",
|
|
11
29
|
"chromonym"
|
|
12
30
|
],
|
|
@@ -29,12 +47,58 @@
|
|
|
29
47
|
".": {
|
|
30
48
|
"types": "./dist/index.d.ts",
|
|
31
49
|
"import": "./dist/index.js"
|
|
32
|
-
}
|
|
50
|
+
},
|
|
51
|
+
"./web": {
|
|
52
|
+
"types": "./dist/colorspaces/web.d.ts",
|
|
53
|
+
"import": "./dist/colorspaces/web.js"
|
|
54
|
+
},
|
|
55
|
+
"./x11": {
|
|
56
|
+
"types": "./dist/colorspaces/x11.d.ts",
|
|
57
|
+
"import": "./dist/colorspaces/x11.js"
|
|
58
|
+
},
|
|
59
|
+
"./pantone": {
|
|
60
|
+
"types": "./dist/colorspaces/pantone.d.ts",
|
|
61
|
+
"import": "./dist/colorspaces/pantone.js"
|
|
62
|
+
},
|
|
63
|
+
"./conversions/hex": {
|
|
64
|
+
"types": "./dist/conversions/hex.d.ts",
|
|
65
|
+
"import": "./dist/conversions/hex.js"
|
|
66
|
+
},
|
|
67
|
+
"./conversions/rgb": {
|
|
68
|
+
"types": "./dist/conversions/rgb.d.ts",
|
|
69
|
+
"import": "./dist/conversions/rgb.js"
|
|
70
|
+
},
|
|
71
|
+
"./conversions/hsl": {
|
|
72
|
+
"types": "./dist/conversions/hsl.d.ts",
|
|
73
|
+
"import": "./dist/conversions/hsl.js"
|
|
74
|
+
},
|
|
75
|
+
"./conversions/hsv": {
|
|
76
|
+
"types": "./dist/conversions/hsv.d.ts",
|
|
77
|
+
"import": "./dist/conversions/hsv.js"
|
|
78
|
+
},
|
|
79
|
+
"./conversions/pantone": {
|
|
80
|
+
"types": "./dist/conversions/pantone.d.ts",
|
|
81
|
+
"import": "./dist/conversions/pantone.js"
|
|
82
|
+
},
|
|
83
|
+
"./math/deltaE": {
|
|
84
|
+
"types": "./dist/math/deltaE.d.ts",
|
|
85
|
+
"import": "./dist/math/deltaE.js"
|
|
86
|
+
},
|
|
87
|
+
"./math/colorSpace": {
|
|
88
|
+
"types": "./dist/math/colorSpace.d.ts",
|
|
89
|
+
"import": "./dist/math/colorSpace.js"
|
|
90
|
+
},
|
|
91
|
+
"./types": {
|
|
92
|
+
"types": "./dist/types.d.ts",
|
|
93
|
+
"import": "./dist/types.js"
|
|
94
|
+
},
|
|
95
|
+
"./package.json": "./package.json"
|
|
33
96
|
},
|
|
34
97
|
"files": [
|
|
35
98
|
"dist",
|
|
36
99
|
"README.md",
|
|
37
|
-
"LICENSE"
|
|
100
|
+
"LICENSE",
|
|
101
|
+
"NOTICE.md"
|
|
38
102
|
],
|
|
39
103
|
"scripts": {
|
|
40
104
|
"build": "tsgo",
|
|
@@ -50,8 +114,8 @@
|
|
|
50
114
|
"@semantic-release/changelog": "^6.0.3",
|
|
51
115
|
"@semantic-release/git": "^10.0.1",
|
|
52
116
|
"@semantic-release/npm": "^13.1.5",
|
|
53
|
-
"@types/bun": "
|
|
54
|
-
"@typescript/native-preview": "
|
|
117
|
+
"@types/bun": "^1.3.12",
|
|
118
|
+
"@typescript/native-preview": "7.0.0-dev.20260417.1",
|
|
55
119
|
"semantic-release": "^25.0.3"
|
|
56
120
|
},
|
|
57
121
|
"publishConfig": {
|
package/dist/math/index.d.ts
DELETED
package/dist/math/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/math/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}
|
package/dist/math/index.js
DELETED
package/dist/math/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/math/index.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+DAA+D;AAC/D,OAAO,EAAE,CAAC"}
|