@xivdyetools/core 1.12.6 → 1.15.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/dist/data/character_colors/index.json +40 -0
- package/dist/data/character_colors/race_specific/hair_colors.json +55394 -0
- package/dist/data/character_colors/race_specific/skin_colors.json +55394 -0
- package/dist/data/character_colors/shared/eye_colors.json +1730 -0
- package/dist/data/character_colors/shared/face_paint_dark.json +866 -0
- package/dist/data/character_colors/shared/face_paint_light.json +866 -0
- package/dist/data/character_colors/shared/highlight_colors.json +1730 -0
- package/dist/data/character_colors/shared/lip_colors_dark.json +866 -0
- package/dist/data/character_colors/shared/lip_colors_light.json +866 -0
- package/dist/data/character_colors/shared/tattoo_colors.json +1730 -0
- package/dist/data/locales/de.json +1 -1
- package/dist/data/locales/en.json +1 -1
- package/dist/data/locales/fr.json +1 -1
- package/dist/data/locales/ja.json +1 -1
- package/dist/data/locales/ko.json +1 -1
- package/dist/data/locales/zh.json +1 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/services/APIService.d.ts +43 -0
- package/dist/services/APIService.d.ts.map +1 -1
- package/dist/services/APIService.js +86 -87
- package/dist/services/APIService.js.map +1 -1
- package/dist/services/CharacterColorService.d.ts +75 -11
- package/dist/services/CharacterColorService.d.ts.map +1 -1
- package/dist/services/CharacterColorService.js +167 -32
- package/dist/services/CharacterColorService.js.map +1 -1
- package/dist/services/DyeService.d.ts +21 -6
- package/dist/services/DyeService.d.ts.map +1 -1
- package/dist/services/DyeService.js +21 -8
- package/dist/services/DyeService.js.map +1 -1
- package/dist/services/dye/DyeDatabase.d.ts.map +1 -1
- package/dist/services/dye/DyeDatabase.js +28 -20
- package/dist/services/dye/DyeDatabase.js.map +1 -1
- package/dist/services/dye/DyeSearch.d.ts +12 -3
- package/dist/services/dye/DyeSearch.d.ts.map +1 -1
- package/dist/services/dye/DyeSearch.js +73 -15
- package/dist/services/dye/DyeSearch.js.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/kd-tree.d.ts.map +1 -1
- package/dist/utils/kd-tree.js +6 -4
- package/dist/utils/kd-tree.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* Service for accessing FFXIV character customization colors and
|
|
5
5
|
* finding matching dyes for hair, eye, skin tones etc.
|
|
6
6
|
*
|
|
7
|
+
* Uses hybrid loading: shared colors are loaded eagerly (sync),
|
|
8
|
+
* race-specific colors are loaded lazily on demand (async).
|
|
9
|
+
*
|
|
7
10
|
* @module services/CharacterColorService
|
|
8
11
|
* @example
|
|
9
12
|
* ```typescript
|
|
@@ -12,20 +15,42 @@
|
|
|
12
15
|
* const characterColors = new CharacterColorService();
|
|
13
16
|
* const dyeService = new DyeService(dyeDatabase);
|
|
14
17
|
*
|
|
15
|
-
* // Get all eye colors
|
|
18
|
+
* // Get all eye colors (sync)
|
|
16
19
|
* const eyeColors = characterColors.getEyeColors();
|
|
17
20
|
*
|
|
21
|
+
* // Get hair colors for a specific race (async)
|
|
22
|
+
* const hairColors = await characterColors.getHairColors('Midlander', 'Male');
|
|
23
|
+
*
|
|
18
24
|
* // Find closest dyes to an eye color
|
|
19
25
|
* const matches = characterColors.findClosestDyes(eyeColors[47], dyeService, 3);
|
|
20
26
|
* ```
|
|
21
27
|
*/
|
|
22
28
|
import type { CharacterColor, CharacterColorMatch, SharedColorCategory, RaceSpecificColorCategory, SubRace, Gender } from '@xivdyetools/types';
|
|
29
|
+
import type { MatchingMethod, OklchWeights } from '../types/index.js';
|
|
23
30
|
import type { DyeService } from './DyeService.js';
|
|
31
|
+
/**
|
|
32
|
+
* Options for finding closest dye matches from character colors.
|
|
33
|
+
*/
|
|
34
|
+
export interface CharacterMatchOptions {
|
|
35
|
+
/** Number of matches to return (default: 3) */
|
|
36
|
+
count?: number;
|
|
37
|
+
/** Color matching algorithm (default: 'oklab') */
|
|
38
|
+
matchingMethod?: MatchingMethod;
|
|
39
|
+
/** Custom weights for oklch-weighted method */
|
|
40
|
+
weights?: OklchWeights;
|
|
41
|
+
}
|
|
24
42
|
/**
|
|
25
43
|
* Service for accessing FFXIV character customization colors
|
|
44
|
+
*
|
|
45
|
+
* Shared colors (eye, lip, tattoo, etc.) are loaded synchronously at import time.
|
|
46
|
+
* Race-specific colors (hair, skin) are loaded lazily on first access.
|
|
26
47
|
*/
|
|
27
48
|
export declare class CharacterColorService {
|
|
28
|
-
private
|
|
49
|
+
private sharedData;
|
|
50
|
+
private hairColorsData;
|
|
51
|
+
private skinColorsData;
|
|
52
|
+
private hairColorsLoading;
|
|
53
|
+
private skinColorsLoading;
|
|
29
54
|
constructor();
|
|
30
55
|
/**
|
|
31
56
|
* Get all eye colors (192 colors)
|
|
@@ -59,36 +84,75 @@ export declare class CharacterColorService {
|
|
|
59
84
|
* Get shared colors by category
|
|
60
85
|
*/
|
|
61
86
|
getSharedColors(category: SharedColorCategory): CharacterColor[];
|
|
87
|
+
/**
|
|
88
|
+
* Load hair colors data lazily
|
|
89
|
+
*/
|
|
90
|
+
private loadHairColors;
|
|
91
|
+
/**
|
|
92
|
+
* Load skin colors data lazily
|
|
93
|
+
*/
|
|
94
|
+
private loadSkinColors;
|
|
62
95
|
/**
|
|
63
96
|
* Get hair colors for a specific subrace and gender (192 colors each)
|
|
97
|
+
*
|
|
98
|
+
* @param subrace - The character subrace (e.g., 'Midlander', 'Highlander')
|
|
99
|
+
* @param gender - The character gender ('Male' or 'Female')
|
|
100
|
+
* @returns Promise resolving to array of hair colors
|
|
64
101
|
*/
|
|
65
|
-
getHairColors(subrace: SubRace, gender: Gender): CharacterColor[]
|
|
102
|
+
getHairColors(subrace: SubRace, gender: Gender): Promise<CharacterColor[]>;
|
|
66
103
|
/**
|
|
67
104
|
* Get skin colors for a specific subrace and gender (192 colors each)
|
|
105
|
+
*
|
|
106
|
+
* @param subrace - The character subrace (e.g., 'Midlander', 'Highlander')
|
|
107
|
+
* @param gender - The character gender ('Male' or 'Female')
|
|
108
|
+
* @returns Promise resolving to array of skin colors
|
|
68
109
|
*/
|
|
69
|
-
getSkinColors(subrace: SubRace, gender: Gender): CharacterColor[]
|
|
110
|
+
getSkinColors(subrace: SubRace, gender: Gender): Promise<CharacterColor[]>;
|
|
70
111
|
/**
|
|
71
112
|
* Get race-specific colors by category
|
|
113
|
+
*
|
|
114
|
+
* @param category - 'hairColors' or 'skinColors'
|
|
115
|
+
* @param subrace - The character subrace
|
|
116
|
+
* @param gender - The character gender
|
|
117
|
+
* @returns Promise resolving to array of colors
|
|
118
|
+
*/
|
|
119
|
+
getRaceSpecificColors(category: RaceSpecificColorCategory, subrace: SubRace, gender: Gender): Promise<CharacterColor[]>;
|
|
120
|
+
/**
|
|
121
|
+
* Preload all race-specific data for faster subsequent access.
|
|
122
|
+
* Call this early (e.g., on app init) to avoid latency when
|
|
123
|
+
* the user first selects a race.
|
|
72
124
|
*/
|
|
73
|
-
|
|
125
|
+
preloadRaceData(): Promise<void>;
|
|
74
126
|
/**
|
|
75
|
-
*
|
|
127
|
+
* Calculate color distance using the specified matching method.
|
|
128
|
+
* Converts RGB to hex for perceptual methods that require it.
|
|
129
|
+
*/
|
|
130
|
+
private calculateDistanceWithMethod;
|
|
131
|
+
/**
|
|
132
|
+
* Find the closest matching dyes to a character color.
|
|
133
|
+
*
|
|
134
|
+
* Supports configurable matching algorithms via the options parameter.
|
|
76
135
|
*
|
|
77
136
|
* @param color - The character color to match
|
|
78
137
|
* @param dyeService - DyeService instance for dye lookup
|
|
79
|
-
* @param
|
|
138
|
+
* @param countOrOptions - Number of matches (legacy) or options object
|
|
80
139
|
* @returns Array of matches sorted by distance (closest first)
|
|
81
140
|
*
|
|
82
141
|
* @example
|
|
83
142
|
* ```typescript
|
|
84
143
|
* const eyeColor = characterColors.getEyeColors()[47];
|
|
144
|
+
*
|
|
145
|
+
* // Legacy usage
|
|
85
146
|
* const matches = characterColors.findClosestDyes(eyeColor, dyeService, 3);
|
|
86
147
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
148
|
+
* // New usage with options
|
|
149
|
+
* const matches = characterColors.findClosestDyes(eyeColor, dyeService, {
|
|
150
|
+
* count: 3,
|
|
151
|
+
* matchingMethod: 'oklab'
|
|
152
|
+
* });
|
|
89
153
|
* ```
|
|
90
154
|
*/
|
|
91
|
-
findClosestDyes(color: CharacterColor, dyeService: DyeService,
|
|
155
|
+
findClosestDyes(color: CharacterColor, dyeService: DyeService, countOrOptions?: number | CharacterMatchOptions): CharacterColorMatch[];
|
|
92
156
|
/**
|
|
93
157
|
* Find the single closest dye to a character color
|
|
94
158
|
*/
|
|
@@ -104,7 +168,7 @@ export declare class CharacterColorService {
|
|
|
104
168
|
/**
|
|
105
169
|
* Get a specific color by index from a race-specific category
|
|
106
170
|
*/
|
|
107
|
-
getRaceSpecificColorByIndex(category: RaceSpecificColorCategory, subrace: SubRace, gender: Gender, index: number): CharacterColor | null
|
|
171
|
+
getRaceSpecificColorByIndex(category: RaceSpecificColorCategory, subrace: SubRace, gender: Gender, index: number): Promise<CharacterColor | null>;
|
|
108
172
|
/**
|
|
109
173
|
* Get all available subraces
|
|
110
174
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CharacterColorService.d.ts","sourceRoot":"","sources":["../../src/services/CharacterColorService.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CharacterColorService.d.ts","sourceRoot":"","sources":["../../src/services/CharacterColorService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,OAAO,EACP,MAAM,EACP,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAO,cAAc,EAAE,YAAY,EA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O,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,cAAc,EAAE,CAAC;IAQ5B;;;;OAIG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAQtC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IA+BnC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,eAAe,CACb,KAAK,EAAE,cAAc,EACrB,UAAU,EAAE,UAAU,EACtB,cAAc,GAAE,MAAM,GAAG,qBAAyB,GACjD,mBAAmB,EAAE;IAkCxB;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,GAAG,mBAAmB,GAAG,IAAI;IAKzF;;OAEG;IACH,sBAAsB,CACpB,KAAK,EAAE,cAAc,EACrB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,MAAM,GAClB,mBAAmB,EAAE;IA2BxB;;OAEG;IACH,qBAAqB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAK1F;;OAEG;IACG,2BAA2B,CAC/B,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IASjC;;OAEG;IACH,oBAAoB,IAAI,OAAO,EAAE;IAIjC;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,cAAc,IAAI,MAAM;IAQxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAM1B"}
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* Service for accessing FFXIV character customization colors and
|
|
5
5
|
* finding matching dyes for hair, eye, skin tones etc.
|
|
6
6
|
*
|
|
7
|
+
* Uses hybrid loading: shared colors are loaded eagerly (sync),
|
|
8
|
+
* race-specific colors are loaded lazily on demand (async).
|
|
9
|
+
*
|
|
7
10
|
* @module services/CharacterColorService
|
|
8
11
|
* @example
|
|
9
12
|
* ```typescript
|
|
@@ -12,115 +15,248 @@
|
|
|
12
15
|
* const characterColors = new CharacterColorService();
|
|
13
16
|
* const dyeService = new DyeService(dyeDatabase);
|
|
14
17
|
*
|
|
15
|
-
* // Get all eye colors
|
|
18
|
+
* // Get all eye colors (sync)
|
|
16
19
|
* const eyeColors = characterColors.getEyeColors();
|
|
17
20
|
*
|
|
21
|
+
* // Get hair colors for a specific race (async)
|
|
22
|
+
* const hairColors = await characterColors.getHairColors('Midlander', 'Male');
|
|
23
|
+
*
|
|
18
24
|
* // Find closest dyes to an eye color
|
|
19
25
|
* const matches = characterColors.findClosestDyes(eyeColors[47], dyeService, 3);
|
|
20
26
|
* ```
|
|
21
27
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
import { ColorConverter } from './color/ColorConverter.js';
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// Eager imports for shared colors (always needed, loaded at build time)
|
|
31
|
+
// =============================================================================
|
|
32
|
+
import colorMeta from '../data/character_colors/index.json';
|
|
33
|
+
import eyeColorsData from '../data/character_colors/shared/eye_colors.json';
|
|
34
|
+
import highlightColorsData from '../data/character_colors/shared/highlight_colors.json';
|
|
35
|
+
import lipColorsDarkData from '../data/character_colors/shared/lip_colors_dark.json';
|
|
36
|
+
import lipColorsLightData from '../data/character_colors/shared/lip_colors_light.json';
|
|
37
|
+
import tattooColorsData from '../data/character_colors/shared/tattoo_colors.json';
|
|
38
|
+
import facePaintDarkData from '../data/character_colors/shared/face_paint_dark.json';
|
|
39
|
+
import facePaintLightData from '../data/character_colors/shared/face_paint_light.json';
|
|
24
40
|
/**
|
|
25
41
|
* Service for accessing FFXIV character customization colors
|
|
42
|
+
*
|
|
43
|
+
* Shared colors (eye, lip, tattoo, etc.) are loaded synchronously at import time.
|
|
44
|
+
* Race-specific colors (hair, skin) are loaded lazily on first access.
|
|
26
45
|
*/
|
|
27
46
|
export class CharacterColorService {
|
|
28
47
|
constructor() {
|
|
29
|
-
|
|
48
|
+
// Shared data loaded eagerly (sync access)
|
|
49
|
+
this.sharedData = {
|
|
50
|
+
eyeColors: eyeColorsData,
|
|
51
|
+
highlightColors: highlightColorsData,
|
|
52
|
+
lipColorsDark: lipColorsDarkData,
|
|
53
|
+
lipColorsLight: lipColorsLightData,
|
|
54
|
+
tattooColors: tattooColorsData,
|
|
55
|
+
facePaintColorsDark: facePaintDarkData,
|
|
56
|
+
facePaintColorsLight: facePaintLightData,
|
|
57
|
+
};
|
|
58
|
+
// Race-specific data loaded lazily (async access)
|
|
59
|
+
this.hairColorsData = null;
|
|
60
|
+
this.skinColorsData = null;
|
|
61
|
+
// Loading promises for deduplication
|
|
62
|
+
this.hairColorsLoading = null;
|
|
63
|
+
this.skinColorsLoading = null;
|
|
64
|
+
// No initialization needed - shared data is already imported
|
|
30
65
|
}
|
|
31
66
|
// ==========================================================================
|
|
32
|
-
// Shared Colors (Race-Agnostic)
|
|
67
|
+
// Shared Colors (Race-Agnostic) - Synchronous API
|
|
33
68
|
// ==========================================================================
|
|
34
69
|
/**
|
|
35
70
|
* Get all eye colors (192 colors)
|
|
36
71
|
*/
|
|
37
72
|
getEyeColors() {
|
|
38
|
-
return this.
|
|
73
|
+
return this.sharedData.eyeColors || [];
|
|
39
74
|
}
|
|
40
75
|
/**
|
|
41
76
|
* Get all hair highlight colors (192 colors)
|
|
42
77
|
*/
|
|
43
78
|
getHighlightColors() {
|
|
44
|
-
return this.
|
|
79
|
+
return this.sharedData.highlightColors || [];
|
|
45
80
|
}
|
|
46
81
|
/**
|
|
47
82
|
* Get all dark lip colors (96 colors)
|
|
48
83
|
*/
|
|
49
84
|
getLipColorsDark() {
|
|
50
|
-
return this.
|
|
85
|
+
return this.sharedData.lipColorsDark || [];
|
|
51
86
|
}
|
|
52
87
|
/**
|
|
53
88
|
* Get all light lip colors (96 colors)
|
|
54
89
|
*/
|
|
55
90
|
getLipColorsLight() {
|
|
56
|
-
return this.
|
|
91
|
+
return this.sharedData.lipColorsLight || [];
|
|
57
92
|
}
|
|
58
93
|
/**
|
|
59
94
|
* Get all tattoo/limbal ring colors (192 colors)
|
|
60
95
|
*/
|
|
61
96
|
getTattooColors() {
|
|
62
|
-
return this.
|
|
97
|
+
return this.sharedData.tattooColors || [];
|
|
63
98
|
}
|
|
64
99
|
/**
|
|
65
100
|
* Get all dark face paint colors (96 colors)
|
|
66
101
|
*/
|
|
67
102
|
getFacePaintColorsDark() {
|
|
68
|
-
return this.
|
|
103
|
+
return this.sharedData.facePaintColorsDark || [];
|
|
69
104
|
}
|
|
70
105
|
/**
|
|
71
106
|
* Get all light face paint colors (96 colors)
|
|
72
107
|
*/
|
|
73
108
|
getFacePaintColorsLight() {
|
|
74
|
-
return this.
|
|
109
|
+
return this.sharedData.facePaintColorsLight || [];
|
|
75
110
|
}
|
|
76
111
|
/**
|
|
77
112
|
* Get shared colors by category
|
|
78
113
|
*/
|
|
79
114
|
getSharedColors(category) {
|
|
80
|
-
return this.
|
|
115
|
+
return this.sharedData[category] || [];
|
|
81
116
|
}
|
|
82
117
|
// ==========================================================================
|
|
83
|
-
// Race-Specific Colors
|
|
118
|
+
// Race-Specific Colors - Asynchronous API (lazy loaded)
|
|
84
119
|
// ==========================================================================
|
|
120
|
+
/**
|
|
121
|
+
* Load hair colors data lazily
|
|
122
|
+
*/
|
|
123
|
+
async loadHairColors() {
|
|
124
|
+
if (this.hairColorsData) {
|
|
125
|
+
return this.hairColorsData;
|
|
126
|
+
}
|
|
127
|
+
// Deduplicate concurrent loads
|
|
128
|
+
if (!this.hairColorsLoading) {
|
|
129
|
+
this.hairColorsLoading = import('../data/character_colors/race_specific/hair_colors.json')
|
|
130
|
+
.then((module) => {
|
|
131
|
+
this.hairColorsData = module.default;
|
|
132
|
+
this.hairColorsLoading = null;
|
|
133
|
+
return this.hairColorsData;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return this.hairColorsLoading;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Load skin colors data lazily
|
|
140
|
+
*/
|
|
141
|
+
async loadSkinColors() {
|
|
142
|
+
if (this.skinColorsData) {
|
|
143
|
+
return this.skinColorsData;
|
|
144
|
+
}
|
|
145
|
+
// Deduplicate concurrent loads
|
|
146
|
+
if (!this.skinColorsLoading) {
|
|
147
|
+
this.skinColorsLoading = import('../data/character_colors/race_specific/skin_colors.json')
|
|
148
|
+
.then((module) => {
|
|
149
|
+
this.skinColorsData = module.default;
|
|
150
|
+
this.skinColorsLoading = null;
|
|
151
|
+
return this.skinColorsData;
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return this.skinColorsLoading;
|
|
155
|
+
}
|
|
85
156
|
/**
|
|
86
157
|
* Get hair colors for a specific subrace and gender (192 colors each)
|
|
158
|
+
*
|
|
159
|
+
* @param subrace - The character subrace (e.g., 'Midlander', 'Highlander')
|
|
160
|
+
* @param gender - The character gender ('Male' or 'Female')
|
|
161
|
+
* @returns Promise resolving to array of hair colors
|
|
87
162
|
*/
|
|
88
|
-
getHairColors(subrace, gender) {
|
|
89
|
-
|
|
163
|
+
async getHairColors(subrace, gender) {
|
|
164
|
+
const data = await this.loadHairColors();
|
|
165
|
+
return data?.[subrace]?.[gender] || [];
|
|
90
166
|
}
|
|
91
167
|
/**
|
|
92
168
|
* Get skin colors for a specific subrace and gender (192 colors each)
|
|
169
|
+
*
|
|
170
|
+
* @param subrace - The character subrace (e.g., 'Midlander', 'Highlander')
|
|
171
|
+
* @param gender - The character gender ('Male' or 'Female')
|
|
172
|
+
* @returns Promise resolving to array of skin colors
|
|
93
173
|
*/
|
|
94
|
-
getSkinColors(subrace, gender) {
|
|
95
|
-
|
|
174
|
+
async getSkinColors(subrace, gender) {
|
|
175
|
+
const data = await this.loadSkinColors();
|
|
176
|
+
return data?.[subrace]?.[gender] || [];
|
|
96
177
|
}
|
|
97
178
|
/**
|
|
98
179
|
* Get race-specific colors by category
|
|
180
|
+
*
|
|
181
|
+
* @param category - 'hairColors' or 'skinColors'
|
|
182
|
+
* @param subrace - The character subrace
|
|
183
|
+
* @param gender - The character gender
|
|
184
|
+
* @returns Promise resolving to array of colors
|
|
185
|
+
*/
|
|
186
|
+
async getRaceSpecificColors(category, subrace, gender) {
|
|
187
|
+
if (category === 'hairColors') {
|
|
188
|
+
return this.getHairColors(subrace, gender);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
return this.getSkinColors(subrace, gender);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Preload all race-specific data for faster subsequent access.
|
|
196
|
+
* Call this early (e.g., on app init) to avoid latency when
|
|
197
|
+
* the user first selects a race.
|
|
99
198
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
199
|
+
async preloadRaceData() {
|
|
200
|
+
await Promise.all([this.loadHairColors(), this.loadSkinColors()]);
|
|
102
201
|
}
|
|
103
202
|
// ==========================================================================
|
|
104
203
|
// Color Matching
|
|
105
204
|
// ==========================================================================
|
|
106
205
|
/**
|
|
107
|
-
*
|
|
206
|
+
* Calculate color distance using the specified matching method.
|
|
207
|
+
* Converts RGB to hex for perceptual methods that require it.
|
|
208
|
+
*/
|
|
209
|
+
calculateDistanceWithMethod(rgb1, rgb2, method, weights) {
|
|
210
|
+
// For RGB method, use simple Euclidean distance
|
|
211
|
+
if (method === 'rgb') {
|
|
212
|
+
return this.calculateDistance(rgb1, rgb2);
|
|
213
|
+
}
|
|
214
|
+
// Convert RGB to hex for perceptual methods
|
|
215
|
+
const hex1 = ColorConverter.rgbToHex(rgb1.r, rgb1.g, rgb1.b);
|
|
216
|
+
const hex2 = ColorConverter.rgbToHex(rgb2.r, rgb2.g, rgb2.b);
|
|
217
|
+
switch (method) {
|
|
218
|
+
case 'cie76':
|
|
219
|
+
return ColorConverter.getDeltaE(hex1, hex2, 'cie76');
|
|
220
|
+
case 'ciede2000':
|
|
221
|
+
return ColorConverter.getDeltaE(hex1, hex2, 'cie2000');
|
|
222
|
+
case 'oklab':
|
|
223
|
+
return ColorConverter.getDeltaE_Oklab(hex1, hex2);
|
|
224
|
+
case 'hyab':
|
|
225
|
+
return ColorConverter.getDeltaE_HyAB(hex1, hex2);
|
|
226
|
+
case 'oklch-weighted':
|
|
227
|
+
return ColorConverter.getDeltaE_OklchWeighted(hex1, hex2, weights);
|
|
228
|
+
default:
|
|
229
|
+
return ColorConverter.getDeltaE_Oklab(hex1, hex2);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Find the closest matching dyes to a character color.
|
|
234
|
+
*
|
|
235
|
+
* Supports configurable matching algorithms via the options parameter.
|
|
108
236
|
*
|
|
109
237
|
* @param color - The character color to match
|
|
110
238
|
* @param dyeService - DyeService instance for dye lookup
|
|
111
|
-
* @param
|
|
239
|
+
* @param countOrOptions - Number of matches (legacy) or options object
|
|
112
240
|
* @returns Array of matches sorted by distance (closest first)
|
|
113
241
|
*
|
|
114
242
|
* @example
|
|
115
243
|
* ```typescript
|
|
116
244
|
* const eyeColor = characterColors.getEyeColors()[47];
|
|
245
|
+
*
|
|
246
|
+
* // Legacy usage
|
|
117
247
|
* const matches = characterColors.findClosestDyes(eyeColor, dyeService, 3);
|
|
118
248
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
249
|
+
* // New usage with options
|
|
250
|
+
* const matches = characterColors.findClosestDyes(eyeColor, dyeService, {
|
|
251
|
+
* count: 3,
|
|
252
|
+
* matchingMethod: 'oklab'
|
|
253
|
+
* });
|
|
121
254
|
* ```
|
|
122
255
|
*/
|
|
123
|
-
findClosestDyes(color, dyeService,
|
|
256
|
+
findClosestDyes(color, dyeService, countOrOptions = 3) {
|
|
257
|
+
// Support both legacy (count number) and new (options object) signatures
|
|
258
|
+
const options = typeof countOrOptions === 'number' ? { count: countOrOptions } : countOrOptions;
|
|
259
|
+
const { count = 3, matchingMethod = 'oklab', weights } = options;
|
|
124
260
|
const allDyes = dyeService.getAllDyes();
|
|
125
261
|
const results = [];
|
|
126
262
|
for (const dye of allDyes) {
|
|
@@ -128,7 +264,7 @@ export class CharacterColorService {
|
|
|
128
264
|
if (dye.category === 'Facewear') {
|
|
129
265
|
continue;
|
|
130
266
|
}
|
|
131
|
-
const distance = this.
|
|
267
|
+
const distance = this.calculateDistanceWithMethod(color.rgb, dye.rgb, matchingMethod, weights);
|
|
132
268
|
results.push({
|
|
133
269
|
characterColor: color,
|
|
134
270
|
dye,
|
|
@@ -181,8 +317,8 @@ export class CharacterColorService {
|
|
|
181
317
|
/**
|
|
182
318
|
* Get a specific color by index from a race-specific category
|
|
183
319
|
*/
|
|
184
|
-
getRaceSpecificColorByIndex(category, subrace, gender, index) {
|
|
185
|
-
const colors = this.getRaceSpecificColors(category, subrace, gender);
|
|
320
|
+
async getRaceSpecificColorByIndex(category, subrace, gender, index) {
|
|
321
|
+
const colors = await this.getRaceSpecificColors(category, subrace, gender);
|
|
186
322
|
return colors.find((c) => c.index === index) || null;
|
|
187
323
|
}
|
|
188
324
|
// ==========================================================================
|
|
@@ -192,20 +328,19 @@ export class CharacterColorService {
|
|
|
192
328
|
* Get all available subraces
|
|
193
329
|
*/
|
|
194
330
|
getAvailableSubraces() {
|
|
195
|
-
|
|
196
|
-
return Object.keys(hairColors);
|
|
331
|
+
return colorMeta.subraces;
|
|
197
332
|
}
|
|
198
333
|
/**
|
|
199
334
|
* Get the data version
|
|
200
335
|
*/
|
|
201
336
|
getVersion() {
|
|
202
|
-
return
|
|
337
|
+
return colorMeta.meta.version;
|
|
203
338
|
}
|
|
204
339
|
/**
|
|
205
340
|
* Get grid column count (always 8)
|
|
206
341
|
*/
|
|
207
342
|
getGridColumns() {
|
|
208
|
-
return
|
|
343
|
+
return colorMeta.meta.gridColumns;
|
|
209
344
|
}
|
|
210
345
|
// ==========================================================================
|
|
211
346
|
// Private Helpers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CharacterColorService.js","sourceRoot":"","sources":["../../src/services/CharacterColorService.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CharacterColorService.js","sourceRoot":"","sources":["../../src/services/CharacterColorService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAYH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAc3D,gFAAgF;AAChF,wEAAwE;AACxE,gFAAgF;AAChF,OAAO,SAAS,MAAM,qCAAqC,CAAC;AAC5D,OAAO,aAAa,MAAM,iDAAiD,CAAC;AAC5E,OAAO,mBAAmB,MAAM,uDAAuD,CAAC;AACxF,OAAO,iBAAiB,MAAM,sDAAsD,CAAC;AACrF,OAAO,kBAAkB,MAAM,uDAAuD,CAAC;AACvF,OAAO,gBAAgB,MAAM,oDAAoD,CAAC;AAClF,OAAO,iBAAiB,MAAM,sDAAsD,CAAC;AACrF,OAAO,kBAAkB,MAAM,uDAAuD,CAAC;AAOvF;;;;;GAKG;AACH,MAAM,OAAO,qBAAqB;IAoBhC;QAnBA,2CAA2C;QACnC,eAAU,GAAqC;YACrD,SAAS,EAAE,aAAiC;YAC5C,eAAe,EAAE,mBAAuC;YACxD,aAAa,EAAE,iBAAqC;YACpD,cAAc,EAAE,kBAAsC;YACtD,YAAY,EAAE,gBAAoC;YAClD,mBAAmB,EAAE,iBAAqC;YAC1D,oBAAoB,EAAE,kBAAsC;SAC7D,CAAC;QAEF,kDAAkD;QAC1C,mBAAc,GAAyB,IAAI,CAAC;QAC5C,mBAAc,GAAyB,IAAI,CAAC;QAEpD,qCAAqC;QAC7B,sBAAiB,GAAkC,IAAI,CAAC;QACxD,sBAAiB,GAAkC,IAAI,CAAC;QAG9D,6DAA6D;IAC/D,CAAC;IAED,6EAA6E;IAC7E,kDAAkD;IAClD,6EAA6E;IAE7E;;OAEG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,IAAI,EAAE,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,IA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,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3E,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC;IACvD,CAAC;IAED,6EAA6E;IAC7E,WAAW;IACX,6EAA6E;IAE7E;;OAEG;IACH,oBAAoB;QAClB,OAAO,SAAS,CAAC,QAAqB,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC;IACpC,CAAC;IAED,6EAA6E;IAC7E,kBAAkB;IAClB,6EAA6E;IAE7E;;OAEG;IACK,iBAAiB,CAAC,IAAS,EAAE,IAAS;QAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QAC3B,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QAC3B,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
import type { Dye, LocalizedDye, Logger } from '../types/index.js';
|
|
28
|
+
import type { FindClosestOptions, FindWithinDistanceOptions } from './dye/DyeSearch.js';
|
|
29
|
+
export type { FindClosestOptions, FindWithinDistanceOptions } from './dye/DyeSearch.js';
|
|
28
30
|
import { type HarmonyOptions } from './dye/HarmonyGenerator.js';
|
|
29
31
|
/**
|
|
30
32
|
* Configuration options for DyeService
|
|
@@ -109,15 +111,28 @@ export declare class DyeService {
|
|
|
109
111
|
maxPrice?: number;
|
|
110
112
|
}): Dye[];
|
|
111
113
|
/**
|
|
112
|
-
* Find closest dye to a given hex color
|
|
113
|
-
*
|
|
114
|
+
* Find closest dye to a given hex color.
|
|
115
|
+
*
|
|
116
|
+
* Per P-7: Uses k-d tree for O(log n) average case vs O(n) linear search.
|
|
117
|
+
* Supports configurable matching algorithms via options object.
|
|
118
|
+
*
|
|
119
|
+
* @param hex - Target color in hex format
|
|
120
|
+
* @param excludeIdsOrOptions - Either an array of IDs to exclude (legacy) or options object
|
|
121
|
+
* @returns Closest matching dye, or null if none found
|
|
114
122
|
*/
|
|
115
|
-
findClosestDye(hex: string,
|
|
123
|
+
findClosestDye(hex: string, excludeIdsOrOptions?: number[] | FindClosestOptions): Dye | null;
|
|
116
124
|
/**
|
|
117
|
-
* Find dyes within a color distance threshold
|
|
118
|
-
*
|
|
125
|
+
* Find dyes within a color distance threshold.
|
|
126
|
+
*
|
|
127
|
+
* Per P-7: Uses k-d tree for efficient range queries.
|
|
128
|
+
* Supports configurable matching algorithms via options object.
|
|
129
|
+
*
|
|
130
|
+
* @param hex - Target color in hex format
|
|
131
|
+
* @param maxDistanceOrOptions - Either maxDistance number (legacy) or options object
|
|
132
|
+
* @param limit - Maximum results (legacy parameter, use options.limit instead)
|
|
133
|
+
* @returns Array of dyes within the distance threshold
|
|
119
134
|
*/
|
|
120
|
-
findDyesWithinDistance(hex: string,
|
|
135
|
+
findDyesWithinDistance(hex: string, maxDistanceOrOptions: number | FindWithinDistanceOptions, limit?: number): Dye[];
|
|
121
136
|
/**
|
|
122
137
|
* Get dyes sorted by brightness
|
|
123
138
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DyeService.d.ts","sourceRoot":"","sources":["../../src/services/DyeService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,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G,EAAE;IAI9D;;;;;OAKG;IACH,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,GAAG,EAAE;IAItF;;;;OAIG;IACH,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,GAAG,EAAE;IAI9D;;;;OAIG;IACH,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,GAAG,EAAE;IAIxE;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,GAAG,EAAE;IAQ5D;;;;;;;;;;;;;OAaG;IACH,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE;IAwB3C;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAcpD;;;;;;;;;;;;;;OAcG;IACH,mBAAmB,IAAI,YAAY,EAAE;IAarC;;;;;;;;;;;;OAYG;IACH,kBAAkB,IAAI,GAAG,EAAE;CAI5B"}
|
|
@@ -129,18 +129,31 @@ export class DyeService {
|
|
|
129
129
|
return this.search.filterDyes(filter);
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
|
-
* Find closest dye to a given hex color
|
|
133
|
-
*
|
|
132
|
+
* Find closest dye to a given hex color.
|
|
133
|
+
*
|
|
134
|
+
* Per P-7: Uses k-d tree for O(log n) average case vs O(n) linear search.
|
|
135
|
+
* Supports configurable matching algorithms via options object.
|
|
136
|
+
*
|
|
137
|
+
* @param hex - Target color in hex format
|
|
138
|
+
* @param excludeIdsOrOptions - Either an array of IDs to exclude (legacy) or options object
|
|
139
|
+
* @returns Closest matching dye, or null if none found
|
|
134
140
|
*/
|
|
135
|
-
findClosestDye(hex,
|
|
136
|
-
return this.search.findClosestDye(hex,
|
|
141
|
+
findClosestDye(hex, excludeIdsOrOptions = []) {
|
|
142
|
+
return this.search.findClosestDye(hex, excludeIdsOrOptions);
|
|
137
143
|
}
|
|
138
144
|
/**
|
|
139
|
-
* Find dyes within a color distance threshold
|
|
140
|
-
*
|
|
145
|
+
* Find dyes within a color distance threshold.
|
|
146
|
+
*
|
|
147
|
+
* Per P-7: Uses k-d tree for efficient range queries.
|
|
148
|
+
* Supports configurable matching algorithms via options object.
|
|
149
|
+
*
|
|
150
|
+
* @param hex - Target color in hex format
|
|
151
|
+
* @param maxDistanceOrOptions - Either maxDistance number (legacy) or options object
|
|
152
|
+
* @param limit - Maximum results (legacy parameter, use options.limit instead)
|
|
153
|
+
* @returns Array of dyes within the distance threshold
|
|
141
154
|
*/
|
|
142
|
-
findDyesWithinDistance(hex,
|
|
143
|
-
return this.search.findDyesWithinDistance(hex,
|
|
155
|
+
findDyesWithinDistance(hex, maxDistanceOrOptions, limit) {
|
|
156
|
+
return this.search.findDyesWithinDistance(hex, maxDistanceOrOptions, limit);
|
|
144
157
|
}
|
|
145
158
|
/**
|
|
146
159
|
* Get dyes sorted by brightness
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DyeService.js","sourceRoot":"","sources":["../../src/services/DyeService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"DyeService.js","sourceRoot":"","sources":["../../src/services/DyeService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,gBAAg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