@ragtechdev/pixel-sprites 0.0.0-stage → 0.9.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.
@@ -0,0 +1,1329 @@
1
+ import { R as Raster } from './compose-BKsBg6Z_.js';
2
+
3
+ type PixelMask = readonly string[];
4
+
5
+ /** A fixed four-tone colour ramp. Ramps only come from the built-in palette tables. */
6
+ type Ramp = {
7
+ readonly base: string;
8
+ readonly shadow: string;
9
+ readonly highlight: string;
10
+ readonly outline: string;
11
+ };
12
+
13
+ declare const headOrientations: {
14
+ readonly front: 1;
15
+ readonly left: 1;
16
+ readonly right: 1;
17
+ readonly back: 1;
18
+ };
19
+ type HeadOrientation = keyof typeof headOrientations;
20
+
21
+ type HairLayer = {
22
+ mask: PixelMask;
23
+ offsetX: number;
24
+ offsetY: number;
25
+ placement: "behindBody" | "behindHead" | "front" | "top";
26
+ /** `top` is drawn over everything, for back hair seen from behind. Drawn without an outline where it lies on other hair, so it joins it. */
27
+ blends?: true;
28
+ /** Where the tail is tied, as the picture column of its middle and the row. An accessory goes here. */
29
+ tie?: {
30
+ x: number;
31
+ y: number;
32
+ tilt?: "slash" | "backslash";
33
+ under?: true;
34
+ };
35
+ };
36
+ type HairFamilyDefinition = {
37
+ byOrientation: Partial<Record<HeadOrientation, readonly HairLayer[]>>;
38
+ fallback: readonly HairLayer[];
39
+ };
40
+ type FrontHairStyle = "centerPart" | "bangs" | "sideSwept";
41
+ /**
42
+ * How long the hair is. Set it first: loose hair hangs to this length and the tail of a ponytail or pigtails
43
+ * is as long as the hair it is made from. The keys are in order from shortest to longest. Bald has no hair at all.
44
+ */
45
+ declare const hairLengths: {
46
+ readonly bald: 1;
47
+ readonly ear: 1;
48
+ readonly chin: 1;
49
+ readonly shoulder: 1;
50
+ readonly armpit: 1;
51
+ readonly midBack: 1;
52
+ };
53
+ type HairLength = keyof typeof hairLengths;
54
+ /** Bald has no hair to style, and at ear length hair is too short to tie up (those are pixie cuts and crops), so only blunt loose hair is offered. */
55
+ declare function backHairStylesFor(length: HairLength): readonly BackHairStyle[];
56
+ /** Whether back hair falls over the shoulders, hangs behind them, or has some of each: a strand over each shoulder and the rest behind. */
57
+ declare const hairDrapes: {
58
+ readonly overShoulder: 1;
59
+ readonly behindShoulder: 1;
60
+ readonly overAndBehindShoulder: 1;
61
+ };
62
+ type HairDrape = keyof typeof hairDrapes;
63
+ /** Only hair long enough to reach the shoulders has a choice; shorter hair is above them either way. */
64
+ declare const hairDrapeApplies: (length: HairLength) => boolean;
65
+ /** A ponytail is a single tail and pigtails are a pair. */
66
+ /** Loose hair is cut blunt, in a V or in a U. */
67
+ type BackHairStyle = "looseBlunt" | "looseV" | "looseU" | "highPonytailRight" | "highPonytailLeft" | "highPonytailMiddle" | "lowPonytailRight" | "lowPonytailLeft" | "lowPonytailMiddle" | "highPigtails" | "lowPigtails";
68
+ declare const frontHairStyles: {
69
+ readonly centerPart: HairFamilyDefinition;
70
+ readonly bangs: HairFamilyDefinition;
71
+ readonly sideSwept: HairFamilyDefinition;
72
+ };
73
+ /** Back hair for each length and drape. The styles follow the length. Ear length can only be loose. */
74
+ declare const backHairStylesByLength: Record<Exclude<HairLength, "bald">, Record<HairDrape, Record<BackHairStyle, HairFamilyDefinition>>>;
75
+ /** An accessory ties up a tail, so it needs hair that is tied: hair of chin length or longer in a ponytail or pigtails. */
76
+ declare const hairAccessoryApplies: (length: HairLength, style: BackHairStyle) => boolean;
77
+ /** A tail down the middle hangs behind the head, so it has no shoulder to fall over. */
78
+ declare const isMiddlePonytail: (style: BackHairStyle) => boolean;
79
+ /** Whether a back hair style is loose hair, of any cut. */
80
+ declare const isLooseHair: (style: BackHairStyle) => boolean;
81
+ /** The back hair styles, by id. The shape of each follows `hairLength`. */
82
+ declare const backHairStyles: {
83
+ readonly looseBlunt: 1;
84
+ readonly looseV: 1;
85
+ readonly looseU: 1;
86
+ readonly highPonytailRight: 1;
87
+ readonly highPonytailLeft: 1;
88
+ readonly highPonytailMiddle: 1;
89
+ readonly lowPonytailRight: 1;
90
+ readonly lowPonytailLeft: 1;
91
+ readonly lowPonytailMiddle: 1;
92
+ readonly highPigtails: 1;
93
+ readonly lowPigtails: 1;
94
+ };
95
+ declare function resolveHairLayers(frontHairStyle: FrontHairStyle, backHairStyle: BackHairStyle, hairLength: HairLength, hairDrape: HairDrape, headOrientation: HeadOrientation): readonly HairLayer[];
96
+
97
+ type ArmPose = "down" | "forward" | "back";
98
+ type LegPose = "neutral" | "step";
99
+ /** `overArms` goes over the arms but under the hair and head, so a chin or a lock of hair stays on top of a sleeve. */
100
+ type GarmentPlacement = "behindBody" | "overBody" | "overArms" | "overlay";
101
+ type GarmentSlot = "top" | "bottom" | "shoes";
102
+ type GarmentLayer = {
103
+ mask: PixelMask;
104
+ offsetX: number;
105
+ offsetY: number;
106
+ placement: GarmentPlacement;
107
+ armPoses?: readonly ArmPose[];
108
+ legPoses?: readonly LegPose[];
109
+ };
110
+ type GarmentDefinition = {
111
+ slot: GarmentSlot;
112
+ /** A one-piece top (a dress, overalls) that also covers the legs, so no bottom is drawn under it. */
113
+ coversBottom?: true;
114
+ byOrientation: Partial<Record<HeadOrientation, readonly GarmentLayer[]>>;
115
+ fallback: readonly GarmentLayer[];
116
+ };
117
+ type TopStyle = "none" | "spaghetti" | "shirt" | "longSleeve" | "overalls" | "dress";
118
+ type BottomStyle = "none" | "shorts" | "skirt";
119
+ type ShoeStyle = "none" | "boots" | "sandals" | "shoes";
120
+ declare const topStyles: {
121
+ readonly none: {
122
+ readonly slot: "top";
123
+ readonly byOrientation: {};
124
+ readonly fallback: readonly [];
125
+ };
126
+ readonly spaghetti: GarmentDefinition;
127
+ readonly shirt: GarmentDefinition;
128
+ readonly longSleeve: GarmentDefinition;
129
+ readonly overalls: GarmentDefinition;
130
+ readonly dress: GarmentDefinition;
131
+ };
132
+ declare const bottomStyles: {
133
+ readonly none: {
134
+ readonly slot: "bottom";
135
+ readonly byOrientation: {};
136
+ readonly fallback: readonly [];
137
+ };
138
+ readonly shorts: GarmentDefinition;
139
+ readonly skirt: GarmentDefinition;
140
+ };
141
+ declare const shoeStyles: {
142
+ readonly none: {
143
+ readonly slot: "shoes";
144
+ readonly byOrientation: {};
145
+ readonly fallback: readonly [];
146
+ };
147
+ readonly boots: GarmentDefinition;
148
+ readonly sandals: GarmentDefinition;
149
+ readonly shoes: GarmentDefinition;
150
+ };
151
+
152
+ /** How the hair falls, from straight to the tightest coils. Straight leaves the hair masks as drawn. */
153
+ declare const hairTextures: {
154
+ readonly straight: 1;
155
+ readonly wavy: 1;
156
+ readonly curly: 1;
157
+ readonly coiled: 1;
158
+ };
159
+ type HairTexture = keyof typeof hairTextures;
160
+ /** How far a texture moves the left edge of a mask, so layers can be shifted back into place. */
161
+ declare const texturePad: (texture: HairTexture) => number;
162
+ /** Adds a texture to the edges of a hair mask. Memoised, so the same mask always gives the same object. */
163
+ declare function textureMask(mask: PixelMask, texture: HairTexture): PixelMask;
164
+
165
+ /** Something that ties up a ponytail or pigtails. Each takes a colour of its own. */
166
+ declare const hairAccessories: {
167
+ readonly none: 1;
168
+ readonly hairtie: 1;
169
+ readonly scrunchie: 1;
170
+ readonly bow: 1;
171
+ };
172
+ type HairAccessory = keyof typeof hairAccessories;
173
+ /**
174
+ * A mask that slants across a sloping tail. `centre` is the column of the mask that goes on the tie, in the mask
175
+ * as drawn for a tail that slopes down to the right, and `up` is how many rows of it are above the tie row.
176
+ */
177
+ type TiltedMask = {
178
+ mask: PixelMask;
179
+ centre: number;
180
+ up: number;
181
+ };
182
+ /**
183
+ * The mask of each accessory, and how many rows it reaches above the row the tail is tied on. Every accessory
184
+ * also has a tilted mask, for a tail that slopes: it slants across the tail instead of lying flat.
185
+ */
186
+ declare const accessoryParts: Record<Exclude<HairAccessory, "none">, {
187
+ mask: PixelMask;
188
+ above: number;
189
+ tilted: TiltedMask;
190
+ outlined: boolean;
191
+ }>;
192
+
193
+ declare const skinPalettes: {
194
+ readonly fair: {
195
+ readonly base: "#F7DCC8";
196
+ readonly shadow: "#DEAC88";
197
+ readonly highlight: "#FAE3D0";
198
+ readonly outline: "#7C4F36";
199
+ };
200
+ readonly light: {
201
+ readonly base: "#f2c9a5";
202
+ readonly shadow: "#d69a6b";
203
+ readonly highlight: "#ffe1c6";
204
+ readonly outline: "#7a3f1c";
205
+ };
206
+ readonly tan: {
207
+ readonly base: "#E0AE7F";
208
+ readonly shadow: "#CA8856";
209
+ readonly highlight: "#ECC8A4";
210
+ readonly outline: "#703F22";
211
+ };
212
+ readonly medium: {
213
+ readonly base: "#d39b72";
214
+ readonly shadow: "#ad6f47";
215
+ readonly highlight: "#e8b48d";
216
+ readonly outline: "#603018";
217
+ };
218
+ readonly brown: {
219
+ readonly base: "#9a6038";
220
+ readonly shadow: "#6f4223";
221
+ readonly highlight: "#b67a52";
222
+ readonly outline: "#3d200f";
223
+ };
224
+ readonly deep: {
225
+ readonly base: "#6E4128";
226
+ readonly shadow: "#63331B";
227
+ readonly highlight: "#A88670";
228
+ readonly outline: "#37170B";
229
+ };
230
+ };
231
+ declare const hairPalettes: {
232
+ readonly brown: {
233
+ readonly base: "#7d5337";
234
+ readonly shadow: "#523220";
235
+ readonly highlight: "#9c704f";
236
+ readonly outline: "#2d1a0f";
237
+ };
238
+ readonly black: {
239
+ readonly base: "#2d2f33";
240
+ readonly shadow: "#15171a";
241
+ readonly highlight: "#474b51";
242
+ readonly outline: "#07080a";
243
+ };
244
+ readonly blonde: {
245
+ readonly base: "#d5b269";
246
+ readonly shadow: "#a88643";
247
+ readonly highlight: "#e6c882";
248
+ readonly outline: "#6e5523";
249
+ };
250
+ readonly red: {
251
+ readonly base: "#B8502A";
252
+ readonly shadow: "#843A1E";
253
+ readonly highlight: "#CD856A";
254
+ readonly outline: "#4A2011";
255
+ };
256
+ readonly auburn: {
257
+ readonly base: "#8A3F2A";
258
+ readonly shadow: "#632D1E";
259
+ readonly highlight: "#AD796A";
260
+ readonly outline: "#371911";
261
+ };
262
+ readonly grey: {
263
+ readonly base: "#A8ADB5";
264
+ readonly shadow: "#797D82";
265
+ readonly highlight: "#C2C6CB";
266
+ readonly outline: "#434548";
267
+ };
268
+ readonly white: {
269
+ readonly base: "#E8E6E0";
270
+ readonly shadow: "#A7A6A1";
271
+ readonly highlight: "#EFEEE9";
272
+ readonly outline: "#5D5C5A";
273
+ };
274
+ readonly pink: {
275
+ readonly base: "#E58BB0";
276
+ readonly shadow: "#A5647F";
277
+ readonly highlight: "#EDAEC8";
278
+ readonly outline: "#5C3846";
279
+ };
280
+ readonly blue: {
281
+ readonly base: "#4F7FC4";
282
+ readonly shadow: "#395B8D";
283
+ readonly highlight: "#84A5D6";
284
+ readonly outline: "#20334E";
285
+ };
286
+ };
287
+ declare const eyePalettes: {
288
+ readonly dark: {
289
+ readonly base: "#2f343b";
290
+ readonly shadow: "#1a1d21";
291
+ readonly highlight: "#4a5563";
292
+ readonly outline: "#090b0f";
293
+ };
294
+ readonly green: {
295
+ readonly base: "#3e5d45";
296
+ readonly shadow: "#24392a";
297
+ readonly highlight: "#58785f";
298
+ readonly outline: "#101b13";
299
+ };
300
+ readonly blue: {
301
+ readonly base: "#3f5f89";
302
+ readonly shadow: "#29405e";
303
+ readonly highlight: "#5e7ba3";
304
+ readonly outline: "#132033";
305
+ };
306
+ readonly brown: {
307
+ readonly base: "#6B4528";
308
+ readonly shadow: "#4D321D";
309
+ readonly highlight: "#977D69";
310
+ readonly outline: "#2B1C10";
311
+ };
312
+ readonly hazel: {
313
+ readonly base: "#8A7A3E";
314
+ readonly shadow: "#63582D";
315
+ readonly highlight: "#ADA278";
316
+ readonly outline: "#373119";
317
+ };
318
+ readonly grey: {
319
+ readonly base: "#7C8794";
320
+ readonly shadow: "#59616B";
321
+ readonly highlight: "#A3ABB4";
322
+ readonly outline: "#32363B";
323
+ };
324
+ };
325
+ declare const clothesPalettes: {
326
+ readonly blue: {
327
+ readonly base: "#6a7da8";
328
+ readonly shadow: "#455275";
329
+ readonly highlight: "#8ea1c9";
330
+ readonly outline: "#232b40";
331
+ };
332
+ readonly red: {
333
+ readonly base: "#9e5656";
334
+ readonly shadow: "#713a3a";
335
+ readonly highlight: "#ba7373";
336
+ readonly outline: "#3f2020";
337
+ };
338
+ readonly green: {
339
+ readonly base: "#5e815f";
340
+ readonly shadow: "#3d5b3f";
341
+ readonly highlight: "#7ea07f";
342
+ readonly outline: "#1f321f";
343
+ };
344
+ readonly yellow: {
345
+ readonly base: "#D6B24A";
346
+ readonly shadow: "#9A8035";
347
+ readonly highlight: "#E2C980";
348
+ readonly outline: "#56471E";
349
+ };
350
+ readonly orange: {
351
+ readonly base: "#C97A3A";
352
+ readonly shadow: "#91582A";
353
+ readonly highlight: "#D9A275";
354
+ readonly outline: "#503117";
355
+ };
356
+ readonly purple: {
357
+ readonly base: "#7C5FA0";
358
+ readonly shadow: "#594473";
359
+ readonly highlight: "#A38FBD";
360
+ readonly outline: "#322640";
361
+ };
362
+ readonly pink: {
363
+ readonly base: "#C97A98";
364
+ readonly shadow: "#91586D";
365
+ readonly highlight: "#D9A2B7";
366
+ readonly outline: "#50313D";
367
+ };
368
+ readonly teal: {
369
+ readonly base: "#4A8F8C";
370
+ readonly shadow: "#356765";
371
+ readonly highlight: "#80B1AF";
372
+ readonly outline: "#1E3938";
373
+ };
374
+ readonly white: {
375
+ readonly base: "#E8E4DA";
376
+ readonly shadow: "#A7A49D";
377
+ readonly highlight: "#EFECE5";
378
+ readonly outline: "#5D5B57";
379
+ };
380
+ readonly grey: {
381
+ readonly base: "#7E838C";
382
+ readonly shadow: "#5B5E65";
383
+ readonly highlight: "#A5A8AF";
384
+ readonly outline: "#323438";
385
+ };
386
+ };
387
+ type SkinTone = keyof typeof skinPalettes;
388
+ type HairColor = keyof typeof hairPalettes;
389
+ type EyeColor = keyof typeof eyePalettes;
390
+ type ClothesColor = keyof typeof clothesPalettes;
391
+
392
+ /** An avatar is fully described by fixed style ids and palette keys. */
393
+ interface AvatarConfig {
394
+ headOrientation?: HeadOrientation;
395
+ skinTone?: SkinTone;
396
+ frontHairStyle?: FrontHairStyle;
397
+ hairLength?: HairLength;
398
+ /** Whether back hair falls over the shoulders or hangs behind them. Only hair that reaches the shoulders has the choice. */
399
+ hairDrape?: HairDrape;
400
+ hairTexture?: HairTexture;
401
+ /** Ties up a ponytail or pigtails. Only tied hair has one. */
402
+ hairAccessory?: HairAccessory;
403
+ backHairStyle?: BackHairStyle;
404
+ hairColor?: HairColor;
405
+ eyeColor?: EyeColor;
406
+ /** The colour of the clothes. Each piece uses it unless it has a colour of its own below. */
407
+ clothesColor?: ClothesColor;
408
+ /** Colours of single pieces. Left out, a piece follows `clothesColor`. */
409
+ topColor?: ClothesColor;
410
+ bottomColor?: ClothesColor;
411
+ /** The colour of the hair accessory. Left out, it follows `clothesColor`. */
412
+ hairAccessoryColor?: ClothesColor;
413
+ shoeColor?: ClothesColor;
414
+ topStyle?: TopStyle;
415
+ bottomStyle?: BottomStyle;
416
+ shoeStyle?: ShoeStyle;
417
+ armPose?: ArmPose;
418
+ legPose?: LegPose;
419
+ }
420
+ /** The pieces that can take a colour of their own. */
421
+ declare const pieceColorFields: readonly ["topColor", "bottomColor", "shoeColor", "hairAccessoryColor"];
422
+ type PieceColorField = (typeof pieceColorFields)[number];
423
+ /** An avatar config with every choice filled in. A piece colour is only there when it differs from `clothesColor`. */
424
+ type ResolvedAvatarConfig = Required<Omit<AvatarConfig, PieceColorField>> & Pick<AvatarConfig, PieceColorField>;
425
+ declare const defaultAvatarConfig: Readonly<Required<Omit<AvatarConfig, PieceColorField>>>;
426
+ /**
427
+ * Fills in defaults and replaces any unknown value with its default, so
428
+ * configs loaded from storage or the network can never select anything
429
+ * outside the fixed tables.
430
+ */
431
+ declare function resolveAvatarConfig(config?: AvatarConfig): ResolvedAvatarConfig;
432
+ /** Cache key for an avatar; equivalent configs (after defaults) share a key. */
433
+ declare function avatarKey(config?: AvatarConfig): string;
434
+ /** Composes an avatar into a colour-resolved raster. Pure; cache by `avatarKey`. */
435
+ declare function buildAvatar(config?: AvatarConfig): Raster;
436
+
437
+ /** A hex colour such as `#e8873a` or `#e83`. */
438
+ type HexColor = `#${string}`;
439
+ /** Returns a hex colour as lowercase `#rrggbb`, or `undefined` for anything that is not a 3 or 6 digit hex colour. */
440
+ declare function parseHex(value: unknown): HexColor | undefined;
441
+
442
+ declare const summerColors: {
443
+ readonly roadBase: "#726962";
444
+ readonly roadCurb: "#8A7D78";
445
+ readonly roadLine: "#FFFFFF";
446
+ readonly pavementBase: "#E9BFA7";
447
+ readonly pavementShade: "#C4A090";
448
+ readonly pavementLight: "#F5D0BA";
449
+ readonly pavementGrout: "#D4C4B4";
450
+ readonly brickBase: "#6B4548";
451
+ readonly brickMortar: "#3E2830";
452
+ readonly brickLight: "#8C6870";
453
+ readonly grass: "#8FB36A";
454
+ readonly grassShade: "#6E9450";
455
+ readonly grassLight: "#A8C682";
456
+ readonly water: "#6FA3C7";
457
+ readonly waterLight: "#A9D0E6";
458
+ readonly waterShade: "#4F7FA6";
459
+ readonly wall: "#C9BFB0";
460
+ readonly wallShade: "#A09585";
461
+ readonly wallFoundation: "#7C7364";
462
+ readonly floor: "#D8C8A8";
463
+ readonly floorLine: "#BFAE8C";
464
+ readonly path: "#D1B48A";
465
+ readonly pathShade: "#B8996D";
466
+ readonly pathLight: "#E3CBA5";
467
+ readonly roof: "#B0604A";
468
+ readonly roofShade: "#864637";
469
+ readonly roofLight: "#CC7E64";
470
+ readonly roofEdge: "#5E2F28";
471
+ readonly roofCast: "#A09585";
472
+ readonly sky: "#BFDDEB";
473
+ readonly skyLight: "#D3E9F3";
474
+ };
475
+ type TileColor = keyof typeof summerColors;
476
+ /**
477
+ * Fixed palettes for the whole tile world, one per season. Summer is the default.
478
+ * Only these can be chosen; tiles never accept arbitrary colours.
479
+ */
480
+ declare const tilePalettes: {
481
+ readonly spring: {
482
+ readonly grass: "#A6CF72";
483
+ readonly grassShade: "#84B35A";
484
+ readonly grassLight: "#C6E49A";
485
+ readonly water: "#74B3D6";
486
+ readonly waterLight: "#B5DCEF";
487
+ readonly waterShade: "#5390B8";
488
+ readonly path: "#D6BC93";
489
+ readonly pathShade: "#BDA177";
490
+ readonly pathLight: "#E8D3B0";
491
+ readonly sky: "#CFE8F5";
492
+ readonly skyLight: "#E1F2FA";
493
+ readonly roadBase: "#726962";
494
+ readonly roadCurb: "#8A7D78";
495
+ readonly roadLine: "#FFFFFF";
496
+ readonly pavementBase: "#E9BFA7";
497
+ readonly pavementShade: "#C4A090";
498
+ readonly pavementLight: "#F5D0BA";
499
+ readonly pavementGrout: "#D4C4B4";
500
+ readonly brickBase: "#6B4548";
501
+ readonly brickMortar: "#3E2830";
502
+ readonly brickLight: "#8C6870";
503
+ readonly wall: "#C9BFB0";
504
+ readonly wallShade: "#A09585";
505
+ readonly wallFoundation: "#7C7364";
506
+ readonly floor: "#D8C8A8";
507
+ readonly floorLine: "#BFAE8C";
508
+ readonly roof: "#B0604A";
509
+ readonly roofShade: "#864637";
510
+ readonly roofLight: "#CC7E64";
511
+ readonly roofEdge: "#5E2F28";
512
+ readonly roofCast: "#A09585";
513
+ };
514
+ readonly summer: {
515
+ readonly roadBase: "#726962";
516
+ readonly roadCurb: "#8A7D78";
517
+ readonly roadLine: "#FFFFFF";
518
+ readonly pavementBase: "#E9BFA7";
519
+ readonly pavementShade: "#C4A090";
520
+ readonly pavementLight: "#F5D0BA";
521
+ readonly pavementGrout: "#D4C4B4";
522
+ readonly brickBase: "#6B4548";
523
+ readonly brickMortar: "#3E2830";
524
+ readonly brickLight: "#8C6870";
525
+ readonly grass: "#8FB36A";
526
+ readonly grassShade: "#6E9450";
527
+ readonly grassLight: "#A8C682";
528
+ readonly water: "#6FA3C7";
529
+ readonly waterLight: "#A9D0E6";
530
+ readonly waterShade: "#4F7FA6";
531
+ readonly wall: "#C9BFB0";
532
+ readonly wallShade: "#A09585";
533
+ readonly wallFoundation: "#7C7364";
534
+ readonly floor: "#D8C8A8";
535
+ readonly floorLine: "#BFAE8C";
536
+ readonly path: "#D1B48A";
537
+ readonly pathShade: "#B8996D";
538
+ readonly pathLight: "#E3CBA5";
539
+ readonly roof: "#B0604A";
540
+ readonly roofShade: "#864637";
541
+ readonly roofLight: "#CC7E64";
542
+ readonly roofEdge: "#5E2F28";
543
+ readonly roofCast: "#A09585";
544
+ readonly sky: "#BFDDEB";
545
+ readonly skyLight: "#D3E9F3";
546
+ };
547
+ readonly autumn: {
548
+ readonly grass: "#B59B47";
549
+ readonly grassShade: "#93803A";
550
+ readonly grassLight: "#D1BC66";
551
+ readonly water: "#6A9AA8";
552
+ readonly waterLight: "#A3C7CE";
553
+ readonly waterShade: "#4D7886";
554
+ readonly path: "#C49A64";
555
+ readonly pathShade: "#A87F4D";
556
+ readonly pathLight: "#DDB98A";
557
+ readonly roof: "#8E4B3A";
558
+ readonly roofShade: "#6B372B";
559
+ readonly roofLight: "#AD6650";
560
+ readonly sky: "#EAD7B9";
561
+ readonly skyLight: "#F3E6CF";
562
+ readonly roadBase: "#726962";
563
+ readonly roadCurb: "#8A7D78";
564
+ readonly roadLine: "#FFFFFF";
565
+ readonly pavementBase: "#E9BFA7";
566
+ readonly pavementShade: "#C4A090";
567
+ readonly pavementLight: "#F5D0BA";
568
+ readonly pavementGrout: "#D4C4B4";
569
+ readonly brickBase: "#6B4548";
570
+ readonly brickMortar: "#3E2830";
571
+ readonly brickLight: "#8C6870";
572
+ readonly wall: "#C9BFB0";
573
+ readonly wallShade: "#A09585";
574
+ readonly wallFoundation: "#7C7364";
575
+ readonly floor: "#D8C8A8";
576
+ readonly floorLine: "#BFAE8C";
577
+ readonly roofEdge: "#5E2F28";
578
+ readonly roofCast: "#A09585";
579
+ };
580
+ readonly winter: {
581
+ readonly grass: "#E4ECEF";
582
+ readonly grassShade: "#C3D1D8";
583
+ readonly grassLight: "#FFFFFF";
584
+ readonly water: "#8DB4CE";
585
+ readonly waterLight: "#C6DDEA";
586
+ readonly waterShade: "#6C94B0";
587
+ readonly path: "#D9D3C7";
588
+ readonly pathShade: "#B9B1A3";
589
+ readonly pathLight: "#EFEAE0";
590
+ readonly roof: "#D8DEE4";
591
+ readonly roofShade: "#AEB8C2";
592
+ readonly roofLight: "#FFFFFF";
593
+ readonly roofEdge: "#5F6B77";
594
+ readonly sky: "#D5DFE8";
595
+ readonly skyLight: "#E8EFF5";
596
+ readonly roadBase: "#726962";
597
+ readonly roadCurb: "#8A7D78";
598
+ readonly roadLine: "#FFFFFF";
599
+ readonly pavementBase: "#E9BFA7";
600
+ readonly pavementShade: "#C4A090";
601
+ readonly pavementLight: "#F5D0BA";
602
+ readonly pavementGrout: "#D4C4B4";
603
+ readonly brickBase: "#6B4548";
604
+ readonly brickMortar: "#3E2830";
605
+ readonly brickLight: "#8C6870";
606
+ readonly wall: "#C9BFB0";
607
+ readonly wallShade: "#A09585";
608
+ readonly wallFoundation: "#7C7364";
609
+ readonly floor: "#D8C8A8";
610
+ readonly floorLine: "#BFAE8C";
611
+ readonly roofCast: "#A09585";
612
+ };
613
+ };
614
+ type TileTheme = keyof typeof tilePalettes;
615
+ declare const tileThemes: TileTheme[];
616
+ /** The palette used when none is given. */
617
+ declare const defaultTileTheme: TileTheme;
618
+ /** The tile colours you can change as a group: each takes one hex colour and shades the group's tones from it. */
619
+ declare const tileColorGroups: {
620
+ readonly grass: readonly ["grass", "grassShade", "grassLight"];
621
+ readonly water: readonly ["water", "waterShade", "waterLight"];
622
+ readonly path: readonly ["path", "pathShade", "pathLight"];
623
+ readonly roof: readonly ["roof", "roofShade", "roofLight"];
624
+ readonly pavement: readonly ["pavementBase", "pavementShade", "pavementLight"];
625
+ };
626
+ type TileColorGroup = keyof typeof tileColorGroups;
627
+ /** Custom colours for some groups of a tile palette, such as `{ grass: "#5fae3c" }`. Anything that is not a group or a hex colour is ignored. */
628
+ type TileColors = {
629
+ [G in TileColorGroup]?: HexColor;
630
+ };
631
+
632
+ /** Road and pavement tiles (`src/world/masks/tiles`). */
633
+ type RoadTileId = "road" | "beige_pavement" | "brick_pavement";
634
+ /** Terrain tiles for towns and interiors (`src/world/masks/tiles`). */
635
+ type TownTileId = "grass" | "tall_grass" | "path" | "water" | "shore" | "wall" | "floor" | "sky" | "roof_top_left" | "roof_top" | "roof_top_right" | "roof_left" | "roof" | "roof_right" | "roof_bottom_left" | "roof_bottom" | "roof_bottom_right" | "beige_pavement_top" | "beige_pavement_bottom" | "beige_pavement_left" | "beige_pavement_right" | "beige_pavement_top_left" | "beige_pavement_top_right" | "beige_pavement_bottom_left" | "beige_pavement_bottom_right" | "wall_left" | "wall_right" | "wall_base" | "wall_base_left" | "wall_base_right";
636
+ type TileId = RoadTileId | TownTileId;
637
+ /** Things that stand on or sit over the terrain. They are shaded sprites, not tiles. */
638
+ type ObjectId = "tree" | "fence" | "door" | "window" | "counter" | "bookshelf" | "rug" | "flower";
639
+
640
+ /** A block is a square arrangement of tiles. Maps refer to blocks by a single character. */
641
+ type Block = readonly (readonly TileId[])[];
642
+ /**
643
+ * Terrain behaviour lives in per-tileset lists of tile ids, not in per-cell
644
+ * flags: every cell that uses a listed tile inherits the behaviour. Objects
645
+ * (trees, doors, furniture) carry their own behaviour, see `objectInfo`.
646
+ */
647
+ interface TileSetDefinition {
648
+ id: string;
649
+ /** Tiles per block side. Defaults to 2. */
650
+ blockSize?: number;
651
+ /** Block art, keyed by a single character. */
652
+ blocks: Readonly<Record<string, Block>>;
653
+ /** Tiles that block movement. */
654
+ solid?: readonly TileId[];
655
+ /** Water tiles (swim or surf). */
656
+ water?: readonly TileId[];
657
+ /** Tiles that can trigger encounters. */
658
+ grass?: readonly TileId[];
659
+ }
660
+ interface TileSet {
661
+ readonly id: string;
662
+ readonly blockSize: number;
663
+ readonly blocks: Readonly<Record<string, Block>>;
664
+ readonly solid: ReadonlySet<TileId>;
665
+ readonly water: ReadonlySet<TileId>;
666
+ readonly grass: ReadonlySet<TileId>;
667
+ }
668
+ /** Validates and freezes a tileset. Throws on unknown tiles, bad block keys or block sizes. */
669
+ declare function defineTileSet(def: TileSetDefinition): TileSet;
670
+
671
+ /** An object placed on a map. `x` and `y` are the tile coordinates of its top-left footprint tile. */
672
+ interface PlacedObject {
673
+ readonly id: ObjectId;
674
+ readonly x: number;
675
+ readonly y: number;
676
+ }
677
+ /** A map is a grid of block characters plus placed objects. One character per block keeps maps tiny. */
678
+ interface TileMap {
679
+ readonly tileset: TileSet;
680
+ readonly rows: readonly string[];
681
+ readonly objects: readonly PlacedObject[];
682
+ /** Width in blocks. */
683
+ readonly width: number;
684
+ /** Height in blocks. */
685
+ readonly height: number;
686
+ }
687
+ interface CellInfo {
688
+ readonly tile: TileId;
689
+ /** The object covering this cell. A standing object wins over a ground one. */
690
+ readonly object?: ObjectId;
691
+ /** True for solid terrain and for solid footprint cells of standing objects. */
692
+ readonly solid: boolean;
693
+ readonly water: boolean;
694
+ readonly grass: boolean;
695
+ readonly counter: boolean;
696
+ readonly door: boolean;
697
+ }
698
+ /**
699
+ * Validates a map against its tileset. Throws on ragged rows, unknown block
700
+ * characters or objects, objects outside the map, and objects of the same
701
+ * layer that overlap.
702
+ */
703
+ declare function defineMap(tileset: TileSet, rows: readonly string[], objects?: readonly PlacedObject[]): TileMap;
704
+ /** Size of the map in tiles. */
705
+ declare function mapTileSize(map: TileMap): {
706
+ width: number;
707
+ height: number;
708
+ };
709
+ /** The terrain tile at tile coordinates (tx, ty), or undefined outside the map. */
710
+ declare function tileAt(map: TileMap, tx: number, ty: number): TileId | undefined;
711
+ /** Terrain and object behaviour of the cell at tile coordinates (tx, ty), or undefined outside the map. */
712
+ declare function queryCell(map: TileMap, tx: number, ty: number): CellInfo | undefined;
713
+ /**
714
+ * Renders the whole map to one raster (16 px per tile) in a fixed tile palette
715
+ * (`tileThemes`). Memoised per map object and palette. Unknown palettes fall
716
+ * back to summer. Seasonal objects (trees, flowers) change with it. `colors` recolours
717
+ * groups of the palette with hex colours (`tileColorGroups`).
718
+ */
719
+ declare function buildMap(map: TileMap, theme?: string, colors?: TileColors): Raster;
720
+
721
+ /**
722
+ * Common colours as fixed four-tone ramps, shared by the colour options of icons and objects.
723
+ * Like every palette in the library they are a fixed table: nothing outside it can be chosen.
724
+ */
725
+ declare const colorRamps: {
726
+ readonly red: {
727
+ readonly outline: "#572120";
728
+ readonly base: "#D9534F";
729
+ readonly shadow: "#9C3C39";
730
+ readonly highlight: "#E48784";
731
+ };
732
+ readonly orange: {
733
+ readonly outline: "#5D3617";
734
+ readonly base: "#E8873A";
735
+ readonly shadow: "#A7612A";
736
+ readonly highlight: "#EFAB75";
737
+ };
738
+ readonly yellow: {
739
+ readonly outline: "#5D4F23";
740
+ readonly base: "#E8C557";
741
+ readonly shadow: "#A78E3F";
742
+ readonly highlight: "#EFD689";
743
+ };
744
+ readonly green: {
745
+ readonly outline: "#263E22";
746
+ readonly base: "#5E9A55";
747
+ readonly shadow: "#446F3D";
748
+ readonly highlight: "#8EB888";
749
+ };
750
+ readonly teal: {
751
+ readonly outline: "#193E3E";
752
+ readonly base: "#3E9C9A";
753
+ readonly shadow: "#2D706F";
754
+ readonly highlight: "#78BAB8";
755
+ };
756
+ readonly blue: {
757
+ readonly outline: "#1E2C42";
758
+ readonly base: "#4A6FA5";
759
+ readonly shadow: "#355077";
760
+ readonly highlight: "#809AC0";
761
+ };
762
+ readonly purple: {
763
+ readonly outline: "#372846";
764
+ readonly base: "#8A63B0";
765
+ readonly shadow: "#63477F";
766
+ readonly highlight: "#AD92C8";
767
+ };
768
+ readonly pink: {
769
+ readonly outline: "#5C3846";
770
+ readonly base: "#E58BB0";
771
+ readonly shadow: "#A5647F";
772
+ readonly highlight: "#EDAEC8";
773
+ };
774
+ readonly brown: {
775
+ readonly outline: "#3E2A1C";
776
+ readonly base: "#9A6A45";
777
+ readonly shadow: "#6F4C32";
778
+ readonly highlight: "#B8977D";
779
+ };
780
+ readonly grey: {
781
+ readonly outline: "#383A3D";
782
+ readonly base: "#8C9099";
783
+ readonly shadow: "#65686E";
784
+ readonly highlight: "#AFB1B8";
785
+ };
786
+ readonly white: {
787
+ readonly outline: "#62605E";
788
+ readonly base: "#F4F1EA";
789
+ readonly shadow: "#B0AEA8";
790
+ readonly highlight: "#F7F5F0";
791
+ };
792
+ };
793
+ type ColorName = keyof typeof colorRamps;
794
+
795
+ type Part = {
796
+ readonly shaded: PixelMask;
797
+ readonly ramp: Ramp;
798
+ readonly x: number;
799
+ readonly y: number;
800
+ } | {
801
+ readonly flat: PixelMask;
802
+ readonly color: string;
803
+ readonly x: number;
804
+ readonly y: number;
805
+ };
806
+
807
+ /**
808
+ * Icon parts grouped by category, named after the lucide.dev categories. A faded
809
+ * variant is registered next to its icon as `<id>_idle`; `buildIcon(id, { idle: true })` finds it.
810
+ */
811
+ declare const iconTables: {
812
+ readonly account: {
813
+ readonly cog: readonly Part[];
814
+ readonly cog_idle: readonly Part[];
815
+ };
816
+ readonly actions: {
817
+ readonly dice: readonly [{
818
+ readonly shaded: PixelMask;
819
+ readonly ramp: {
820
+ readonly outline: "#6B5A48";
821
+ readonly base: "#F7F1E1";
822
+ readonly shadow: "#DDD2BC";
823
+ readonly highlight: "#FFFFFF";
824
+ };
825
+ readonly x: 0;
826
+ readonly y: 0;
827
+ }, {
828
+ readonly flat: PixelMask;
829
+ readonly color: "#2B2A26";
830
+ readonly x: 2;
831
+ readonly y: 3;
832
+ }];
833
+ readonly reset: readonly [{
834
+ readonly shaded: PixelMask;
835
+ readonly ramp: {
836
+ readonly outline: "#1F2A44";
837
+ readonly base: "#34507F";
838
+ readonly shadow: "#263B60";
839
+ readonly highlight: "#5A78A8";
840
+ };
841
+ readonly x: 0;
842
+ readonly y: 0;
843
+ }];
844
+ readonly save: readonly [{
845
+ readonly shaded: PixelMask;
846
+ readonly ramp: {
847
+ readonly outline: "#243A5C";
848
+ readonly base: "#4A6FA5";
849
+ readonly shadow: "#375684";
850
+ readonly highlight: "#7596C8";
851
+ };
852
+ readonly x: 0;
853
+ readonly y: 0;
854
+ }, {
855
+ readonly flat: PixelMask;
856
+ readonly color: "#B5A58A";
857
+ readonly x: 3;
858
+ readonly y: 1;
859
+ }, {
860
+ readonly flat: PixelMask;
861
+ readonly color: "#F7F1E1";
862
+ readonly x: 3;
863
+ readonly y: 7;
864
+ }];
865
+ readonly copy: readonly [{
866
+ readonly shaded: PixelMask;
867
+ readonly ramp: {
868
+ readonly outline: "#4F5666";
869
+ readonly base: "#A9B2C2";
870
+ readonly shadow: "#8993A6";
871
+ readonly highlight: "#C9D0DB";
872
+ };
873
+ readonly x: 0;
874
+ readonly y: 0;
875
+ }, {
876
+ readonly shaded: PixelMask;
877
+ readonly ramp: {
878
+ readonly outline: "#5E6470";
879
+ readonly base: "#EEF0F3";
880
+ readonly shadow: "#C9CED8";
881
+ readonly highlight: "#FFFFFF";
882
+ };
883
+ readonly x: 4;
884
+ readonly y: 3;
885
+ }, {
886
+ readonly flat: PixelMask;
887
+ readonly color: "#5E6470";
888
+ readonly x: 6;
889
+ readonly y: 6;
890
+ }];
891
+ };
892
+ readonly buildings: {
893
+ readonly cottage: readonly Part[];
894
+ readonly cottage_idle: readonly Part[];
895
+ readonly cottage_row: readonly Part[];
896
+ readonly cottage_row_idle: readonly Part[];
897
+ };
898
+ readonly communication: {
899
+ readonly comment: readonly [{
900
+ readonly shaded: PixelMask;
901
+ readonly ramp: {
902
+ readonly outline: "#8A8478";
903
+ readonly base: "#F7F1E1";
904
+ readonly shadow: "#DDD2BC";
905
+ readonly highlight: "#FFFFFF";
906
+ };
907
+ readonly x: 0;
908
+ readonly y: 0;
909
+ }, {
910
+ readonly flat: PixelMask;
911
+ readonly color: "#5A3B22";
912
+ readonly x: 4;
913
+ readonly y: 2;
914
+ }];
915
+ readonly bird_letter: readonly Part[];
916
+ readonly bird_letter_idle: readonly Part[];
917
+ readonly bird_perch: readonly [{
918
+ readonly shaded: PixelMask;
919
+ readonly ramp: {
920
+ readonly outline: "#6B5A48";
921
+ readonly base: "#F7F1E1";
922
+ readonly shadow: "#DDD2BC";
923
+ readonly highlight: "#FFFFFF";
924
+ };
925
+ readonly x: 0;
926
+ readonly y: 9;
927
+ }, {
928
+ readonly flat: PixelMask;
929
+ readonly color: "#B5A58A";
930
+ readonly x: 0;
931
+ readonly y: 9;
932
+ }, {
933
+ readonly flat: PixelMask;
934
+ readonly color: "#C8505A";
935
+ readonly x: 6;
936
+ readonly y: 12;
937
+ }, {
938
+ readonly shaded: PixelMask;
939
+ readonly ramp: {
940
+ readonly outline: "#5E6470";
941
+ readonly base: "#EEF0F3";
942
+ readonly shadow: "#C9CED8";
943
+ readonly highlight: "#FFFFFF";
944
+ };
945
+ readonly x: 1;
946
+ readonly y: 0;
947
+ }, {
948
+ readonly shaded: PixelMask;
949
+ readonly ramp: {
950
+ readonly outline: "#4F5666";
951
+ readonly base: "#A9B2C2";
952
+ readonly shadow: "#8993A6";
953
+ readonly highlight: "#C9D0DB";
954
+ };
955
+ readonly x: 3;
956
+ readonly y: 3;
957
+ }, {
958
+ readonly flat: PixelMask;
959
+ readonly color: "#2B2A26";
960
+ readonly x: 9;
961
+ readonly y: 1;
962
+ }, {
963
+ readonly flat: PixelMask;
964
+ readonly color: "#E8B04A";
965
+ readonly x: 12;
966
+ readonly y: 2;
967
+ }];
968
+ readonly winged_letter: readonly [{
969
+ readonly shaded: PixelMask;
970
+ readonly ramp: {
971
+ readonly outline: "#4F5666";
972
+ readonly base: "#A9B2C2";
973
+ readonly shadow: "#8993A6";
974
+ readonly highlight: "#C9D0DB";
975
+ };
976
+ readonly x: 0;
977
+ readonly y: 0;
978
+ }, {
979
+ readonly shaded: PixelMask;
980
+ readonly ramp: {
981
+ readonly outline: "#4F5666";
982
+ readonly base: "#A9B2C2";
983
+ readonly shadow: "#8993A6";
984
+ readonly highlight: "#C9D0DB";
985
+ };
986
+ readonly x: 13;
987
+ readonly y: 0;
988
+ }, {
989
+ readonly shaded: PixelMask;
990
+ readonly ramp: {
991
+ readonly outline: "#6B5A48";
992
+ readonly base: "#F7F1E1";
993
+ readonly shadow: "#DDD2BC";
994
+ readonly highlight: "#FFFFFF";
995
+ };
996
+ readonly x: 4;
997
+ readonly y: 4;
998
+ }, {
999
+ readonly flat: PixelMask;
1000
+ readonly color: "#B5A58A";
1001
+ readonly x: 4;
1002
+ readonly y: 4;
1003
+ }, {
1004
+ readonly flat: PixelMask;
1005
+ readonly color: "#C8505A";
1006
+ readonly x: 8;
1007
+ readonly y: 7;
1008
+ }];
1009
+ readonly envelope: readonly [{
1010
+ readonly shaded: PixelMask;
1011
+ readonly ramp: {
1012
+ readonly outline: "#6B5A48";
1013
+ readonly base: "#F7F1E1";
1014
+ readonly shadow: "#DDD2BC";
1015
+ readonly highlight: "#FFFFFF";
1016
+ };
1017
+ readonly x: 0;
1018
+ readonly y: 0;
1019
+ }, {
1020
+ readonly flat: PixelMask;
1021
+ readonly color: "#B5A58A";
1022
+ readonly x: 0;
1023
+ readonly y: 0;
1024
+ }, {
1025
+ readonly flat: PixelMask;
1026
+ readonly color: "#C8505A";
1027
+ readonly x: 6;
1028
+ readonly y: 5;
1029
+ }];
1030
+ readonly envelope_idle: readonly [{
1031
+ readonly shaded: PixelMask;
1032
+ readonly ramp: {
1033
+ readonly outline: "#8A8478";
1034
+ readonly base: "#EFEBDD";
1035
+ readonly shadow: "#DCD6C4";
1036
+ readonly highlight: "#FAF8F1";
1037
+ };
1038
+ readonly x: 0;
1039
+ readonly y: 0;
1040
+ }, {
1041
+ readonly flat: PixelMask;
1042
+ readonly color: "#CFC8B6";
1043
+ readonly x: 0;
1044
+ readonly y: 0;
1045
+ }];
1046
+ readonly mailbox: readonly [{
1047
+ readonly shaded: PixelMask;
1048
+ readonly ramp: {
1049
+ readonly outline: "#5A3B22";
1050
+ readonly base: "#B98A57";
1051
+ readonly shadow: "#946A3E";
1052
+ readonly highlight: "#D6AB78";
1053
+ };
1054
+ readonly x: 6;
1055
+ readonly y: 9;
1056
+ }, {
1057
+ readonly shaded: PixelMask;
1058
+ readonly ramp: {
1059
+ readonly outline: "#243A5C";
1060
+ readonly base: "#4A6FA5";
1061
+ readonly shadow: "#375684";
1062
+ readonly highlight: "#7596C8";
1063
+ };
1064
+ readonly x: 0;
1065
+ readonly y: 3;
1066
+ }, {
1067
+ readonly flat: PixelMask;
1068
+ readonly color: "#2B2A26";
1069
+ readonly x: 4;
1070
+ readonly y: 6;
1071
+ }, {
1072
+ readonly flat: PixelMask;
1073
+ readonly color: "#5A3B22";
1074
+ readonly x: 14;
1075
+ readonly y: 1;
1076
+ }, {
1077
+ readonly shaded: PixelMask;
1078
+ readonly ramp: {
1079
+ readonly outline: "#7A2E3A";
1080
+ readonly base: "#E0525F";
1081
+ readonly shadow: "#B53A4A";
1082
+ readonly highlight: "#F4909A";
1083
+ };
1084
+ readonly x: 14;
1085
+ readonly y: 0;
1086
+ }];
1087
+ };
1088
+ readonly design: {
1089
+ readonly quill: readonly Part[];
1090
+ readonly quill_idle: readonly Part[];
1091
+ };
1092
+ readonly files: {
1093
+ readonly note_ribbon: readonly [{
1094
+ readonly shaded: PixelMask;
1095
+ readonly ramp: {
1096
+ readonly outline: "#6B5A48";
1097
+ readonly base: "#F7F1E1";
1098
+ readonly shadow: "#DDD2BC";
1099
+ readonly highlight: "#FFFFFF";
1100
+ };
1101
+ readonly x: 0;
1102
+ readonly y: 0;
1103
+ }, {
1104
+ readonly flat: PixelMask;
1105
+ readonly color: "#C8505A";
1106
+ readonly x: 0;
1107
+ readonly y: 4;
1108
+ }, {
1109
+ readonly shaded: PixelMask;
1110
+ readonly ramp: {
1111
+ readonly outline: "#7A2E3A";
1112
+ readonly base: "#E0525F";
1113
+ readonly shadow: "#B53A4A";
1114
+ readonly highlight: "#F4909A";
1115
+ };
1116
+ readonly x: 4;
1117
+ readonly y: 3;
1118
+ }];
1119
+ readonly bookmark: readonly [{
1120
+ readonly shaded: PixelMask;
1121
+ readonly ramp: {
1122
+ readonly outline: "#7A3E30";
1123
+ readonly base: "#E59A82";
1124
+ readonly shadow: "#C97C65";
1125
+ readonly highlight: "#F2BBA8";
1126
+ };
1127
+ readonly x: 0;
1128
+ readonly y: 0;
1129
+ }];
1130
+ readonly bookmark_idle: readonly [{
1131
+ readonly shaded: PixelMask;
1132
+ readonly ramp: {
1133
+ readonly outline: "#8A8478";
1134
+ readonly base: "#F7F1E1";
1135
+ readonly shadow: "#DDD2BC";
1136
+ readonly highlight: "#FFFFFF";
1137
+ };
1138
+ readonly x: 0;
1139
+ readonly y: 0;
1140
+ }];
1141
+ readonly pinned_note: readonly [{
1142
+ readonly shaded: PixelMask;
1143
+ readonly ramp: {
1144
+ readonly outline: "#6B5A48";
1145
+ readonly base: "#F7F1E1";
1146
+ readonly shadow: "#DDD2BC";
1147
+ readonly highlight: "#FFFFFF";
1148
+ };
1149
+ readonly x: 0;
1150
+ readonly y: 1;
1151
+ }, {
1152
+ readonly flat: PixelMask;
1153
+ readonly color: "#B5A58A";
1154
+ readonly x: 1;
1155
+ readonly y: 4;
1156
+ }, {
1157
+ readonly shaded: PixelMask;
1158
+ readonly ramp: {
1159
+ readonly outline: "#7A2E3A";
1160
+ readonly base: "#E0525F";
1161
+ readonly shadow: "#B53A4A";
1162
+ readonly highlight: "#F4909A";
1163
+ };
1164
+ readonly x: 4;
1165
+ readonly y: 0;
1166
+ }];
1167
+ };
1168
+ readonly "food-beverage": {
1169
+ readonly basket: readonly [{
1170
+ readonly shaded: PixelMask;
1171
+ readonly ramp: {
1172
+ readonly outline: "#6E4A1E";
1173
+ readonly base: "#D79A4A";
1174
+ readonly shadow: "#B57A33";
1175
+ readonly highlight: "#EDBB78";
1176
+ };
1177
+ readonly x: 2;
1178
+ readonly y: 0;
1179
+ }, {
1180
+ readonly shaded: PixelMask;
1181
+ readonly ramp: {
1182
+ readonly outline: "#5A3B22";
1183
+ readonly base: "#B98A57";
1184
+ readonly shadow: "#946A3E";
1185
+ readonly highlight: "#D6AB78";
1186
+ };
1187
+ readonly x: 0;
1188
+ readonly y: 4;
1189
+ }, {
1190
+ readonly flat: PixelMask;
1191
+ readonly color: "#5A3B22";
1192
+ readonly x: 2;
1193
+ readonly y: 7;
1194
+ }];
1195
+ readonly jar: readonly [{
1196
+ readonly shaded: PixelMask;
1197
+ readonly ramp: {
1198
+ readonly outline: "#3F5F70";
1199
+ readonly base: "#9CC7DB";
1200
+ readonly shadow: "#7FAFC6";
1201
+ readonly highlight: "#D6EBF5";
1202
+ };
1203
+ readonly x: 0;
1204
+ readonly y: 2;
1205
+ }, {
1206
+ readonly shaded: PixelMask;
1207
+ readonly ramp: {
1208
+ readonly outline: "#7A2E3A";
1209
+ readonly base: "#E0525F";
1210
+ readonly shadow: "#B53A4A";
1211
+ readonly highlight: "#F4909A";
1212
+ };
1213
+ readonly x: 2;
1214
+ readonly y: 5;
1215
+ }, {
1216
+ readonly shaded: PixelMask;
1217
+ readonly ramp: {
1218
+ readonly outline: "#6E5420";
1219
+ readonly base: "#E8C557";
1220
+ readonly shadow: "#C4A23F";
1221
+ readonly highlight: "#F6E39A";
1222
+ };
1223
+ readonly x: 1;
1224
+ readonly y: 0;
1225
+ }];
1226
+ };
1227
+ readonly navigation: {
1228
+ readonly willage_map: readonly Part[];
1229
+ readonly willage_map_idle: readonly Part[];
1230
+ readonly notice_board: readonly Part[];
1231
+ readonly notice_board_idle: readonly Part[];
1232
+ };
1233
+ readonly social: {
1234
+ readonly heart: readonly [{
1235
+ readonly shaded: PixelMask;
1236
+ readonly ramp: {
1237
+ readonly outline: "#7A2E3A";
1238
+ readonly base: "#E0525F";
1239
+ readonly shadow: "#B53A4A";
1240
+ readonly highlight: "#F4909A";
1241
+ };
1242
+ readonly x: 0;
1243
+ readonly y: 0;
1244
+ }];
1245
+ readonly heart_empty: readonly [{
1246
+ readonly shaded: PixelMask;
1247
+ readonly ramp: {
1248
+ readonly outline: "#8A8478";
1249
+ readonly base: "#F7F1E1";
1250
+ readonly shadow: "#DDD2BC";
1251
+ readonly highlight: "#FFFFFF";
1252
+ };
1253
+ readonly x: 0;
1254
+ readonly y: 0;
1255
+ }];
1256
+ };
1257
+ };
1258
+ type IconCategory = keyof typeof iconTables;
1259
+
1260
+ type Tables = typeof iconTables;
1261
+ type StoredId = {
1262
+ [C in IconCategory]: keyof Tables[C];
1263
+ }[IconCategory] & string;
1264
+ declare const IDLE = "_idle";
1265
+ /** Every icon is centred on a square canvas this big, so all icons share one size (the widest icon is 20 pixels). */
1266
+ declare const ICON_SIZE = 20;
1267
+ /** The id of an icon. Faded variants are not separate icons: ask for them with `{ idle: true }`. */
1268
+ type IconId = Exclude<StoredId, `${string}${typeof IDLE}`>;
1269
+ /** The common colours an icon can be shown in. */
1270
+ declare const iconColors: readonly ["red", "orange", "yellow", "green", "teal", "blue", "purple", "pink", "brown", "grey"];
1271
+ type IconColor = (typeof iconColors)[number];
1272
+ interface IconOptions {
1273
+ /** The faded, unsealed look for something that is switched off or not current. Ignored for icons without one. */
1274
+ idle?: boolean;
1275
+ /**
1276
+ * Show the icon's main colour as another common colour, or as any hex colour such as `"#e8873a"`.
1277
+ * Ignored for icons without one (`colorableIconIds`) and for anything that is not one of those.
1278
+ */
1279
+ color?: IconColor | HexColor;
1280
+ }
1281
+ declare const iconIds: IconId[];
1282
+ /** The icons that have a main colour you can change with `color`. */
1283
+ declare const colorableIconIds: IconId[];
1284
+ /** The ids that have an idle look. */
1285
+ declare const idleIconIds: IconId[];
1286
+ /** Icon ids grouped by category. */
1287
+ declare const iconCategories: { [C in IconCategory]: readonly IconId[]; };
1288
+ /** Returns the (memoised) coloured, shaded raster for an icon. Colours come from fixed ramps. */
1289
+ declare function buildIcon(id: IconId, options?: IconOptions): Raster;
1290
+
1291
+ declare const variantSizes: readonly [8, 16];
1292
+ declare const colorDepths: readonly [1, 2];
1293
+ /**
1294
+ * Fixed four-colour palettes that can be swapped in for an image's own colours, darkest first.
1295
+ * Like every palette in the library this is a fixed table: only these names can be chosen.
1296
+ */
1297
+ declare const palettePresets: {
1298
+ readonly "game-boy": readonly ["#0f380f", "#306230", "#8bac0f", "#9bbc0f"];
1299
+ readonly sepia: readonly ["#2b1d0e", "#6b4a2b", "#b08a5a", "#e8d3a8"];
1300
+ readonly pastel: readonly ["#5a4a6a", "#a0a0d8", "#f4a8c4", "#fff0b0"];
1301
+ readonly night: readonly ["#0b1020", "#1f2a4a", "#4a5d8f", "#aab8e0"];
1302
+ readonly "autumn-glow": readonly ["#3b1f14", "#8a3f1c", "#d27a2a", "#f2c46b"];
1303
+ readonly mint: readonly ["#16342e", "#2f7a68", "#7cc4a8", "#e4f5e8"];
1304
+ };
1305
+ type PalettePreset = keyof typeof palettePresets;
1306
+ declare const paletteNames: PalettePreset[];
1307
+ type VariantSize = (typeof variantSizes)[number];
1308
+ type ColorDepth = (typeof colorDepths)[number];
1309
+ interface VariantOptions {
1310
+ /** Fit the image inside a square of this many pixels, centred on a transparent background. */
1311
+ size?: VariantSize;
1312
+ /** Reduce colours: 1 is black and white, 2 is four greys. Leave out for the original colours. */
1313
+ bits?: ColorDepth;
1314
+ /** Swap in a fixed palette by brightness (see `palettePresets`): each colour takes the palette tone for its own brightness, so a faded image stays faded. Applied after `bits`. */
1315
+ palette?: PalettePreset;
1316
+ }
1317
+ /**
1318
+ * Returns a smaller and/or lower colour depth copy of a raster, memoised per raster.
1319
+ * Values outside `variantSizes`, `colorDepths` and `paletteNames` are ignored, so the raster comes back unchanged.
1320
+ * Transparency is kept at every depth.
1321
+ */
1322
+ declare function toVariant(raster: Raster, options?: VariantOptions): Raster;
1323
+ /**
1324
+ * Like `toVariant`, for a whole map: `size` is the pixels per tile (8 or 16), not the size of the
1325
+ * whole picture, so the map keeps its tiles and proportions. 16 is the original. `bits` works as in `toVariant`.
1326
+ */
1327
+ declare function toMapVariant(raster: Raster, options?: VariantOptions): Raster;
1328
+
1329
+ export { backHairStyles as $, type ArmPose as A, type BackHairStyle as B, type ColorName as C, type SkinTone as D, type EyeColor as E, type FrontHairStyle as F, type GarmentDefinition as G, type HexColor as H, ICON_SIZE as I, type TileColor as J, type TileColorGroup as K, type LegPose as L, type TileMap as M, type TileSetDefinition as N, type ObjectId as O, type PalettePreset as P, type TileTheme as Q, type Ramp as R, type ShoeStyle as S, type TileId as T, type TiltedMask as U, type TopStyle as V, type TownTileId as W, type VariantOptions as X, type VariantSize as Y, accessoryParts as Z, avatarKey as _, type TileColors as a, backHairStylesByLength as a0, backHairStylesFor as a1, bottomStyles as a2, buildAvatar as a3, buildIcon as a4, buildMap as a5, clothesPalettes as a6, colorDepths as a7, colorRamps as a8, colorableIconIds as a9, resolveHairLayers as aA, shoeStyles as aB, skinPalettes as aC, textureMask as aD, texturePad as aE, tileAt as aF, tileColorGroups as aG, tilePalettes as aH, tileThemes as aI, toMapVariant as aJ, toVariant as aK, topStyles as aL, variantSizes as aM, defaultAvatarConfig as aa, defaultTileTheme as ab, defineMap as ac, defineTileSet as ad, eyePalettes as ae, frontHairStyles as af, hairAccessories as ag, hairAccessoryApplies as ah, hairDrapeApplies as ai, hairDrapes as aj, hairLengths as ak, hairPalettes as al, hairTextures as am, iconCategories as an, iconColors as ao, iconIds as ap, idleIconIds as aq, isLooseHair as ar, isMiddlePonytail as as, mapTileSize as at, paletteNames as au, palettePresets as av, parseHex as aw, pieceColorFields as ax, queryCell as ay, resolveAvatarConfig as az, type TileSet as b, type AvatarConfig as c, type Block as d, type BottomStyle as e, type CellInfo as f, type ClothesColor as g, type ColorDepth as h, type GarmentLayer as i, type GarmentPlacement as j, type GarmentSlot as k, type HairAccessory as l, type HairColor as m, type HairDrape as n, type HairLayer as o, type HairLength as p, type HairTexture as q, type HeadOrientation as r, type IconCategory as s, type IconColor as t, type IconId as u, type IconOptions as v, type PieceColorField as w, type PlacedObject as x, type ResolvedAvatarConfig as y, type RoadTileId as z };