@xivdyetools/types 1.3.0 → 1.4.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/README.md +6 -2
- package/dist/color/index.d.ts +1 -1
- package/dist/color/index.d.ts.map +1 -1
- package/dist/color/rgb.d.ts +13 -0
- package/dist/color/rgb.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ For smaller bundle sizes, import from specific modules:
|
|
|
40
40
|
|
|
41
41
|
```typescript
|
|
42
42
|
// Color types
|
|
43
|
-
import { RGB, HSV, HexColor, createHexColor, VisionType } from '@xivdyetools/types/color';
|
|
43
|
+
import { RGB, HSV, LAB, HexColor, createHexColor, VisionType } from '@xivdyetools/types/color';
|
|
44
44
|
|
|
45
45
|
// Dye types
|
|
46
46
|
import { Dye, LocalizedDye, DyeWithDistance, DyeDatabase } from '@xivdyetools/types/dye';
|
|
@@ -73,10 +73,14 @@ import { LocaleCode, LocaleData, TranslationKey } from '@xivdyetools/types/local
|
|
|
73
73
|
```typescript
|
|
74
74
|
import { RGB, HSV, HexColor, createHexColor, DyeId, createDyeId } from '@xivdyetools/types';
|
|
75
75
|
|
|
76
|
-
// RGB and
|
|
76
|
+
// RGB, HSV, and LAB interfaces
|
|
77
77
|
const red: RGB = { r: 255, g: 0, b: 0 };
|
|
78
78
|
const redHsv: HSV = { h: 0, s: 100, v: 100 };
|
|
79
79
|
|
|
80
|
+
// LAB color space (for perceptual color matching)
|
|
81
|
+
import { LAB } from '@xivdyetools/types';
|
|
82
|
+
const redLab: LAB = { L: 53.23, a: 80.11, b: 67.22 };
|
|
83
|
+
|
|
80
84
|
// Branded types with validation
|
|
81
85
|
const hex: HexColor = createHexColor('#ff6b6b'); // Validates and normalizes to "#FF6B6B"
|
|
82
86
|
const dyeId: DyeId | null = createDyeId(1); // Returns null if invalid (not 1-200)
|
package/dist/color/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module color
|
|
7
7
|
*/
|
|
8
|
-
export type { RGB, HSV } from './rgb.js';
|
|
8
|
+
export type { RGB, HSV, LAB } from './rgb.js';
|
|
9
9
|
export type { HexColor, DyeId, Hue, Saturation } from './branded.js';
|
|
10
10
|
export { createHexColor, createDyeId, createHue, createSaturation } from './branded.js';
|
|
11
11
|
export type { VisionType, Matrix3x3, ColorblindMatrices } from './colorblind.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/color/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/color/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAG9C,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGxF,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/color/rgb.d.ts
CHANGED
|
@@ -29,4 +29,17 @@ export interface HSV {
|
|
|
29
29
|
/** Value/Brightness (0-100 percent) */
|
|
30
30
|
v: number;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* CIE LAB color representation (perceptually uniform color space)
|
|
34
|
+
* Used for DeltaE color difference calculations
|
|
35
|
+
* @example { L: 53.23, a: 80.11, b: 67.22 } // Red
|
|
36
|
+
*/
|
|
37
|
+
export interface LAB {
|
|
38
|
+
/** Lightness (0-100) */
|
|
39
|
+
L: number;
|
|
40
|
+
/** Green-Red axis (approximately -128 to 127) */
|
|
41
|
+
a: number;
|
|
42
|
+
/** Blue-Yellow axis (approximately -128 to 127) */
|
|
43
|
+
b: number;
|
|
44
|
+
}
|
|
32
45
|
//# sourceMappingURL=rgb.d.ts.map
|
package/dist/color/rgb.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rgb.d.ts","sourceRoot":"","sources":["../../src/color/rgb.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,WAAW,GAAG;IAClB,0BAA0B;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,4BAA4B;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,GAAG;IAClB,0BAA0B;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,iCAAiC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,uCAAuC;IACvC,CAAC,EAAE,MAAM,CAAC;CACX"}
|
|
1
|
+
{"version":3,"file":"rgb.d.ts","sourceRoot":"","sources":["../../src/color/rgb.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,WAAW,GAAG;IAClB,0BAA0B;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,4BAA4B;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,GAAG;IAClB,0BAA0B;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,iCAAiC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,uCAAuC;IACvC,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;;GAIG;AACH,MAAM,WAAW,GAAG;IAClB,wBAAwB;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,iDAAiD;IACjD,CAAC,EAAE,MAAM,CAAC;IACV,mDAAmD;IACnD,CAAC,EAAE,MAAM,CAAC;CACX"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @packageDocumentation
|
|
14
14
|
*/
|
|
15
|
-
export type { RGB, HSV } from './color/index.js';
|
|
15
|
+
export type { RGB, HSV, LAB } from './color/index.js';
|
|
16
16
|
export type { HexColor, DyeId, Hue, Saturation } from './color/index.js';
|
|
17
17
|
export { createHexColor, createDyeId, createHue, createSaturation } from './color/index.js';
|
|
18
18
|
export type { VisionType, Matrix3x3, ColorblindMatrices } from './color/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC5F,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAKlF,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKtF,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,sBA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