-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathbricklink-colors.js
More file actions
657 lines (648 loc) · 12.1 KB
/
bricklink-colors.js
File metadata and controls
657 lines (648 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
let ALL_BRICKLINK_SOLID_COLORS = [
{
name: "White",
hex: "#ffffff",
id: 1,
},
{
name: "Very Light Gray",
hex: "#e8e8e8",
id: 49,
},
{
name: "Very Light Bluish Gray",
hex: "#e4e8e8",
id: 99,
},
{
name: "Light Bluish Gray",
hex: "#afb5c7",
id: 86,
},
{
name: "Light Gray",
hex: "#9c9c9c",
id: 9,
},
{
name: "Dark Gray",
hex: "#6b5a5a",
id: 10,
},
{
name: "Dark Bluish Gray",
hex: "#595d60",
id: 85,
},
{
name: "Black",
hex: "#212121",
id: 11,
},
{
name: "Dark Red",
hex: "#6a0e15",
id: 59,
},
{
name: "Red",
hex: "#b30006",
id: 5,
},
{
name: "Rust",
hex: "#b52c20",
id: 27,
},
{
name: "Coral",
hex: "#f88379",
id: 220,
},
{
name: "Salmon",
hex: "#f45c40",
id: 25,
},
{
name: "Light Salmon",
hex: "#ffdedc",
id: 26,
},
{
name: "Sand Red",
hex: "#8c6b6b",
id: 58,
},
{
name: "Reddish Brown",
hex: "#89351d",
id: 88,
},
{
name: "Brown",
hex: "#532115",
id: 8,
},
{
name: "Dark Brown",
hex: "#330000",
id: 120,
},
{
name: "Dark Tan",
hex: "#907450",
id: 69,
},
{
name: "Tan",
hex: "#dec69c",
id: 2,
},
{
name: "Light Nougat",
hex: "#feccb0",
id: 90,
},
{
name: "Nougat",
hex: "#ffaf7d",
id: 28,
},
{
name: "Medium Nougat",
hex: "#e3a05b",
id: 150,
},
{
name: "Dark Nougat",
hex: "#e78b3e",
id: 225,
},
{
name: "Medium Brown",
hex: "#a16c42",
id: 91,
},
{
name: "Fabuland Brown",
hex: "#b3694e",
id: 106,
},
{
name: "Fabuland Orange",
hex: "#ef9121",
id: 160,
},
{
name: "Earth Orange",
hex: "#e6881d",
id: 29,
},
{
name: "Dark Orange",
hex: "#b35408",
id: 68,
},
{
name: "Neon Orange",
hex: "#fa5947",
id: 165,
},
{
name: "Orange",
hex: "#ff7e14",
id: 4,
},
{
name: "Medium Orange",
hex: "#ffa531",
id: 31,
},
{
name: "Bright Light Orange",
hex: "#f7ba30",
id: 110,
},
{
name: "Light Orange",
hex: "#f7ad63",
id: 32,
},
{
name: "Very Light Orange",
hex: "#e6c05d",
id: 96,
},
{
name: "Dark Yellow",
hex: "#dd982e",
id: 161,
},
{
name: "Yellow",
hex: "#f7d117",
id: 3,
},
{
name: "Bright Light Yellow",
hex: "#f3e055",
id: 103,
},
{
name: "Light Yellow",
hex: "#ffe383",
id: 33,
},
{
name: "Light Lime",
hex: "#ebee8f",
id: 35,
},
{
name: "Yellowish Green",
hex: "#dfeea5",
id: 158,
},
{
name: "Neon Green",
hex: "#bcef66",
id: 166,
},
{
name: "Medium Lime",
hex: "#bdc618",
id: 76,
},
{
name: "Lime",
hex: "#a6ca55",
id: 34,
},
{
name: "Olive Green",
hex: "#7c9051",
id: 155,
},
{
name: "Dark Green",
hex: "#2e5543",
id: 80,
},
{
name: "Green",
hex: "#00642e",
id: 6,
},
{
name: "Bright Green",
hex: "#10cb31",
id: 36,
},
{
name: "Medium Green",
hex: "#62f58e",
id: 37,
},
{
name: "Light Green",
hex: "#a5dbb5",
id: 38,
},
{
name: "Sand Green",
hex: "#76a290",
id: 48,
},
{
name: "Dark Turquoise",
hex: "#008a80",
id: 39,
},
{
name: "Light Turquoise",
hex: "#31b5ca",
id: 40,
},
{
name: "Aqua",
hex: "#b5d3d6",
id: 41,
},
{
name: "Light Aqua",
hex: "#ccffff",
id: 152,
},
{
name: "Dark Blue",
hex: "#143044",
id: 63,
},
{
name: "Blue",
hex: "#0057a6",
id: 7,
},
{
name: "Dark Azure",
hex: "#3399ff",
id: 153,
},
{
name: "Medium Azure",
hex: "#42c0fb",
id: 156,
},
{
name: "Medium Blue",
hex: "#61afff",
id: 42,
},
{
name: "Maersk Blue",
hex: "#6badd6",
id: 72,
},
{
name: "Bright Light Blue",
hex: "#9fc3e9",
id: 105,
},
{
name: "Light Blue",
hex: "#b4d2e3",
id: 62,
},
{
name: "Sky Blue",
hex: "#7dbfdd",
id: 87,
},
{
name: "Sand Blue",
hex: "#5a7184",
id: 55,
},
{
name: "Blue-Violet",
hex: "#506cef",
id: 97,
},
{
name: "Dark Blue-Violet",
hex: "#2032b0",
id: 109,
},
{
name: "Violet",
hex: "#3448a4",
id: 43,
},
{
name: "Medium Violet",
hex: "#9391e4",
id: 73,
},
{
name: "Light Violet",
hex: "#c9cae2",
id: 44,
},
{
name: "Dark Purple",
hex: "#5f2683",
id: 89,
},
{
name: "Purple",
hex: "#a5499c",
id: 24,
},
{
name: "Light Purple",
hex: "#da70d6",
id: 93,
},
{
name: "Medium Lavender",
hex: "#885e9e",
id: 157,
},
{
name: "Clikits Lavender",
hex: "#e0aad9",
id: 227,
},
{
name: "Lavender",
hex: "#b18cbf",
id: 154,
},
{
name: "Sand Purple",
hex: "#b57da5",
id: 54,
},
{
name: "Magenta",
hex: "#b52952",
id: 71,
},
{
name: "Dark Pink",
hex: "#c87080",
id: 47,
},
{
name: "Medium Dark Pink",
hex: "#f785b1",
id: 94,
},
{
name: "Bright Pink",
hex: "#ffbbff",
id: 104,
},
{
name: "Pink",
hex: "#ffc0cb",
id: 23,
},
{
name: "Light Pink",
hex: "#ffe1ff",
id: 56,
},
{
name: "Neon Yellow",
hex: "#fffc00",
id: 236,
},
// add in some pearl colors to support specific sets,
// but avoid the other pearl colors for now since they
// may weirdly replace similar solid non pearl
{
name: "Pearl Gold",
hex: "#e79500",
id: 115,
},
{
name: "Pearl Dark Gray",
hex: "#666660",
id: 77,
},
{
name: "Flat Silver",
hex: "#898788",
id: 95,
},
// The 2 below are new in 2022
// {
// name: "Medium Brown",
// hex: "#A16C42",
// id: 240,
// },
{
name: "Medium Tan",
hex: "#d9c594",
id: 241,
},
];
const HEX_TO_COLOR_NAME = {};
ALL_BRICKLINK_SOLID_COLORS.forEach((color) => {
HEX_TO_COLOR_NAME[color.hex] = color.name;
});
const COLOR_NAME_TO_ID = {};
ALL_BRICKLINK_SOLID_COLORS.forEach((color) => {
COLOR_NAME_TO_ID[color.name] = color.id;
});
const KNOWN_BRICKLINK_STUD_COLOR_NAMES = [
"Black",
"Blue",
"Bright Green",
"Bright Light Yellow",
"Bright Pink",
"Brown",
"Dark Blue",
"Dark Bluish Gray",
"Dark Brown",
"Dark Gray",
"Dark Orange",
"Dark Pink",
"Dark Purple",
"Dark Red",
"Dark Tan",
"Green",
"Light Bluish Gray",
"Light Gray",
"Lime",
"Magenta",
"Medium Azure",
"Medium Lime",
"Medium Nougat",
"Olive Green",
"Orange",
"Red",
"Reddish Brown",
"Sand Blue",
"Sand Green",
"Tan",
"White",
"Yellow",
"Yellowish Green",
"Trans-Black",
"Trans-Bright Green",
"Trans-Clear",
"Trans-Dark Blue",
"Trans-Dark Pink",
"Trans-Green",
"Trans-Light Blue",
"Trans-Medium Blue",
"Trans-Neon Green",
"Trans-Neon Orange",
"Trans-Neon Yellow",
"Trans-Orange",
"Trans-Purple",
"Trans-Red",
"Trans-Yellow",
"Chrome Antique Brass",
"Chrome Gold",
"Chrome Silver",
"Flat Silver",
"Pearl Dark Gray",
"Pearl Gold",
"Pearl Light Gray",
"Metallic Silver",
"Glow In Dark Opaque",
"Glow In Dark White",
"Medium Lavender", // manually added from Batman
"Light Aqua", // manually added from Batman
"Medium Tan",// manually added
];
const KNOWN_BRICKLINK_TILE_COLOR_NAMES = [
"Black",
"Blue",
"Bright Light Blue",
"Bright Light Orange",
"Bright Pink",
"Coral",
"Dark Blue",
"Dark Bluish Gray",
"Dark Brown",
"Dark Orange",
"Dark Red",
"Dark Tan",
"Lavender",
"Light Bluish Gray",
"Light Nougat",
"Lime",
"Medium Blue",
"Medium Nougat",
"Nougat",
"Olive Green",
"Orange",
"Red",
"Reddish Brown",
"Sand Blue",
"Tan",
"White",
"Yellow",
"Trans-Black",
"Trans-Bright Green",
"Trans-Clear",
"Trans-Dark Blue",
"Trans-Dark Pink",
"Trans-Green",
"Trans-Light Blue",
"Trans-Orange",
"Trans-Purple",
"Trans-Red",
"Trans-Yellow",
"Flat Silver",
"Pearl Gold",
"Satin Trans-Light Blue",
"Satin White",
"Glow In Dark White",
"Glitter Trans-Clear",
"Glitter Trans-Dark Pink",
"Glitter Trans-Light Blue",
"Dark Bluish Gray", // manually added from Warhol
"Dark Pink", // manually added from Warhol
"Magenta", // manually added from Warhol
"Medium Azure", // manually added from Warhol
"Neon Yellow", // manually added from dots
"Dark Azure", // manually added from art project
"Light Aqua", // manually added from art project
"Bright Light Yellow", // manually added from art project
"Bright Green", // manually added from art project
"Dark Turquoise", // manually added from dots
"Yellowish Green", // manually added from dots
];
const BRICKLINK_STUD_COLORS = ALL_BRICKLINK_SOLID_COLORS.filter((color) =>
KNOWN_BRICKLINK_STUD_COLOR_NAMES.includes(color.name)
).sort((a, b) => {
return a.name > b.name ? 1 : -1;
});
const BRICKLINK_TILE_COLORS = ALL_BRICKLINK_SOLID_COLORS.filter((color) =>
KNOWN_BRICKLINK_TILE_COLOR_NAMES.includes(color.name)
).sort((a, b) => {
return a.name > b.name ? 1 : -1;
});
const ADDITIONAL_COLORS = ["Very Light Gray"];
let ALL_VALID_BRICKLINK_COLORS = ALL_BRICKLINK_SOLID_COLORS.sort((a, b) => {
return a.name > b.name ? 1 : -1;
});
// .filter(
// color =>
// KNOWN_BRICKLINK_STUD_COLOR_NAMES.includes(color.name) ||
// KNOWN_BRICKLINK_TILE_COLOR_NAMES.includes(color.name) ||
// ADDITIONAL_COLORS.includes(color.name)
// ).sort((a, b) => {
// return a.name > b.name ? 1 : -1;
// });
const PIXEL_TYPE_OPTIONS = [
{
name: "1x1 Round Tile",
number: 98138,
},
{
name: "1x1 Round Plate",
number: 4073,
},
{
name: "1x1 Square Tile",
number: "3070b",
},
{
name: "1x1 Square Plate",
number: 3024,
},
{
name: "1x1 Square Brick",
number: 3005,
},
{
name: "Variable Tile",
number: "variable_tile",
},
{
name: "Variable Plate",
number: "variable_plate",
},
{
name: "Variable Brick",
number: "variable_brick",
},
];
// use this for instructions - we prioritize readability over accuracy here
const PIXEL_TYPE_TO_FLATTENED = {
98138: 98138,
4073: 98138,
3024: "3070b",
"3070b": "3070b",
3005: "3070b",
variable_tile: "variable_tile",
variable_plate: "variable_tile",
variable_brick: "variable_tile",
};