agent-robot-avatar 0.5.2 → 0.7.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +56 -7
  2. package/README.md +93 -16
  3. package/agent-robot-avatar-lite.js +44 -0
  4. package/agent-robot-avatar.js +2 -2
  5. package/index.d.ts +94 -17
  6. package/lite.d.ts +5 -0
  7. package/package.json +12 -5
  8. package/src/agent-robot-avatar-actions.js +17 -14
  9. package/src/agent-robot-avatar-core.js +5 -2
  10. package/src/agent-robot-avatar-gestures.js +9 -0
  11. package/src/agent-robot-avatar-runtime.js +58 -12
  12. package/src/agent-robot-avatar-skin-patterns.js +234 -0
  13. package/src/agent-robot-avatar-skins.js +256 -0
  14. package/src/agent-robot-avatar-version.js +1 -1
  15. package/src/agent-robot-avatar-waiting.js +30 -6
  16. package/src/skins/catalog.js +218 -0
  17. package/src/skins/collection-materials.js +118 -0
  18. package/src/skins/eyelids.js +32 -0
  19. package/src/skins/glaze-variants.js +29 -0
  20. package/src/skins/layered-texture.js +162 -0
  21. package/src/skins/material-data.js +111 -0
  22. package/src/skins/material-library.js +302 -0
  23. package/src/skins/metal-tint.js +11 -0
  24. package/src/skins/more-materials.js +69 -0
  25. package/src/skins/native.js +754 -0
  26. package/src/skins/paints.js +3 -0
  27. package/src/skins/revised-materials.js +44 -0
  28. package/src/skins/second-pass-materials.js +71 -0
  29. package/src/skins/soft-materials.js +111 -0
  30. package/src/skins/sports-materials.js +38 -0
  31. package/src/skins/wood-materials.js +68 -0
  32. package/assets/support/alipay.png +0 -0
  33. package/assets/support/wechat-pay.png +0 -0
  34. package/docs/README.de.md +0 -186
  35. package/docs/README.es.md +0 -186
  36. package/docs/README.fr.md +0 -186
  37. package/docs/README.ja.md +0 -186
  38. package/docs/README.ko.md +0 -186
  39. package/docs/README.pt.md +0 -186
  40. package/docs/README.ru.md +0 -186
  41. package/docs/README.zh-CN.md +0 -190
  42. package/docs/README.zh-TW.md +0 -186
  43. package/src/agent-robot-avatar-antenna-flash.js +0 -127
@@ -2,9 +2,13 @@ import AgentRobotAvatar, { registerAvatarExtension } from './agent-robot-avatar-
2
2
  import { WRAP_CYCLE, drawWrapWaiting } from './agent-robot-avatar-wrap.js';
3
3
 
4
4
  const WAITING_CYCLE = 3200;
5
+ const WAVE_WAITING_CYCLE = 1100;
6
+ const WAVE_WAITING_REPEATS = 3;
5
7
  const proto = AgentRobotAvatar.prototype;
6
8
 
7
9
  const clamp01 = value => Math.max(0, Math.min(1, value));
10
+ const smooth = value => { const t = clamp01(value); return t * t * (3 - 2 * t); };
11
+ const waitingDuration = variant => variant === 'wave' ? WAVE_WAITING_CYCLE * WAVE_WAITING_REPEATS : variant === 'wrap' ? WRAP_CYCLE : WAITING_CYCLE;
8
12
 
9
13
  function dispatchWaitingState(instance, state) {
10
14
  instance.dispatchEvent(new CustomEvent('face-state', {
@@ -28,8 +32,10 @@ function setEyeOrbitTransform(eye, x, scaleX, scaleY) {
28
32
  }
29
33
 
30
34
  async function enterWaiting(instance, continuous, source, options = {}) {
31
- const variant = options?.variant ?? 'default';
32
- if (variant !== 'default' && variant !== 'wrap') throw new TypeError(`Unknown waiting variant: ${variant}`);
35
+ // 'spin' names the default variant, matching the waiting-spin action.
36
+ const requested = options?.variant ?? 'default';
37
+ const variant = requested === 'spin' ? 'default' : requested;
38
+ if (variant !== 'default' && variant !== 'wrap' && variant !== 'wave') throw new TypeError(`Unknown waiting variant: ${requested}`);
33
39
  instance.noteActivity();
34
40
  instance._inputWanted = false;
35
41
 
@@ -44,7 +50,7 @@ async function enterWaiting(instance, continuous, source, options = {}) {
44
50
  instance._look.y = 0;
45
51
  instance._waitingFx = {
46
52
  start: performance.now(),
47
- duration: variant === 'wrap' ? WRAP_CYCLE : WAITING_CYCLE,
53
+ duration: waitingDuration(variant),
48
54
  variant,
49
55
  continuous: continuous === true,
50
56
  source,
@@ -57,7 +63,7 @@ proto.waiting = async function(options = {}) {
57
63
  const token = await enterWaiting(this, false, 'play', options);
58
64
  if (token == null) return;
59
65
 
60
- await this._wait(options?.variant === 'wrap' ? WRAP_CYCLE : WAITING_CYCLE);
66
+ await this._wait(waitingDuration(options?.variant));
61
67
  if (token !== this._transitionToken || !this._waitingRequested) return;
62
68
  this._waitingRequested = false;
63
69
  this._waitingFx = null;
@@ -89,6 +95,22 @@ function drawWaiting(now) {
89
95
  drawWrapWaiting(this, phaseMs);
90
96
  return;
91
97
  }
98
+ if (fx.variant === 'wave') {
99
+ // Restore the first embedded prototype's staggered vertical eye motion.
100
+ // Ease its entry/finite exit; continuous loops keep their phase at the seam.
101
+ let amplitude = 10 * smooth(elapsed / 140);
102
+ if (!fx.continuous) amplitude *= smooth((fx.duration - phaseMs) / 140);
103
+ const angle = (elapsed % WAVE_WAITING_CYCLE) / WAVE_WAITING_CYCLE * Math.PI * 2;
104
+ for (const [side, x, offset] of [['left', 86, 0], ['right', 154, 0.7]]) {
105
+ this[`_${side}Base`].setAttribute('cx', '0');
106
+ this[`_${side}Base`].setAttribute('cy', '0');
107
+ this[`_${side}Base`].setAttribute('rx', '27');
108
+ this[`_${side}Base`].setAttribute('ry', '29');
109
+ this[`_${side}Eye`].setAttribute('transform',
110
+ `translate(${x} ${(126 + Math.sin(angle + offset) * amplitude).toFixed(2)})`);
111
+ }
112
+ return;
113
+ }
92
114
 
93
115
  // Original R43 waiting-eye motion: two continuous horizontal orbits per 3.2 s cycle.
94
116
  const angle = t * Math.PI * 4;
@@ -113,9 +135,10 @@ registerAvatarExtension({
113
135
  waiting() { return this.waiting(); },
114
136
  wait() { return this.waiting(); },
115
137
  'waiting-wrap'() { return this.waiting({ variant: 'wrap' }); },
138
+ 'waiting-wave'() { return this.waiting({ variant: 'wave' }); },
116
139
  },
117
140
  beforePlay(action) {
118
- if (action === 'waiting' || action === 'wait' || action === 'waiting-wrap') return;
141
+ if (action === 'waiting' || action === 'wait' || action === 'waiting-wrap' || action === 'waiting-wave') return;
119
142
  this._waitingRequested = false;
120
143
  this._waitingFx = null;
121
144
  },
@@ -126,5 +149,6 @@ registerAvatarExtension({
126
149
  draw: drawWaiting,
127
150
  });
128
151
 
129
- export { AgentRobotAvatar, WAITING_CYCLE };
152
+ export { AgentRobotAvatar, WAITING_CYCLE, WAVE_WAITING_CYCLE };
130
153
  export default AgentRobotAvatar;
154
+
@@ -0,0 +1,218 @@
1
+ // The public skin catalog. A skin's number is permanent: the series number
2
+ // followed by two digits, so 305 is the fifth skin of series 3. A new skin takes
3
+ // the next free number in its series; a removed skin's number is never reused.
4
+ // Titles may be reworded at any time, and the order in each series' list is the
5
+ // display order, independent of the numbers.
6
+ export const SKIN_SERIES = [
7
+ {"number": 1, "id": "glaze", "zh": "彩色玻璃", "en": "Glaze", "skins": ["101", "102", "103", "104", "105", "106"]},
8
+ {"number": 2, "id": "ice", "zh": "淡彩玻璃", "en": "Ice glass", "skins": ["201", "202", "203", "204", "205", "206"]},
9
+ {"number": 3, "id": "gummy", "zh": "软糖", "en": "Gummy", "skins": ["301", "302", "303", "304", "305", "306", "307", "308", "309", "310", "311", "312"]},
10
+ {"number": 4, "id": "candy", "zh": "糖果玻璃", "en": "Candy glass", "skins": ["401", "402", "403", "404", "405", "406"]},
11
+ {"number": 5, "id": "acrylic", "zh": "亚克力", "en": "Acrylic", "skins": ["501", "502", "503", "504", "505", "506", "507", "508", "509", "510", "511", "512"]},
12
+ {"number": 6, "id": "jelly", "zh": "果冻", "en": "Jelly", "skins": ["601", "602", "603", "604", "605", "606", "607", "608", "609", "610", "611", "612"]},
13
+ {"number": 7, "id": "gradient", "zh": "渐变", "en": "Gradient", "skins": ["701", "702", "703", "704", "705", "706", "707", "708", "709", "710", "711", "712"]},
14
+ {"number": 8, "id": "frosted", "zh": "磨砂玻璃系列", "en": "Frosted glass", "skins": ["801", "802", "803", "804", "805", "806"]},
15
+ {"number": 9, "id": "metal", "zh": "磨砂金属", "en": "Metal", "skins": ["901", "902", "903", "904", "905", "906", "907", "908", "909", "910", "911", "912", "913", "914", "915", "916", "917", "918", "919", "920", "921", "922", "923", "924", "925", "926", "927", "928", "929", "930"]},
16
+ {"number": 10, "id": "gem", "zh": "宝石与陶瓷", "en": "Gems and ceramics", "skins": ["1001", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1012"]},
17
+ {"number": 11, "id": "wood", "zh": "木系列", "en": "Wood", "skins": ["1101", "1102", "1103", "1104", "1105", "1106"]},
18
+ {"number": 12, "id": "ball", "zh": "球类", "en": "Balls", "skins": ["1201", "1202", "1203", "1204", "1205", "1206", "1207", "1208", "1209", "1210"]},
19
+ {"number": 13, "id": "gloss", "zh": "透明与流光", "en": "Clear and shimmer", "skins": ["1301", "1302", "1303", "1304", "1305"]},
20
+ {"number": 14, "id": "fabric", "zh": "织物与皮革", "en": "Fabric and leather", "skins": ["1401", "1402", "1403", "1404", "1405", "1406", "1407", "1408", "1409", "1410", "1411", "1412"]},
21
+ {"number": 15, "id": "food", "zh": "甜点与水果", "en": "Sweets and fruit", "skins": ["1501", "1502", "1503", "1504", "1505", "1506", "1507", "1508", "1509", "1510", "1511", "1512"]},
22
+ {"number": 16, "id": "nature", "zh": "自然", "en": "Nature", "skins": ["1601", "1602", "1603", "1604", "1605", "1606", "1607", "1608", "1609", "1610", "1611", "1612"]},
23
+ {"number": 17, "id": "pattern", "zh": "图案与科技", "en": "Patterns and tech", "skins": ["1701", "1702", "1703", "1704", "1705", "1706", "1707", "1708", "1709", "1710", "1711", "1712", "1713", "1714", "1715", "1716", "1717"]},
24
+ ];
25
+
26
+ // Numbers that were once published and must not be used again.
27
+ export const RETIRED_SKINS = [];
28
+
29
+ export const SKIN_CATALOG = {
30
+ '101': {"series":"glaze","zh":"曜石黑","en":"Glaze · Black","base":["#39434f","#39434f","#101923","#090d14"],"material":"blackglaze"},
31
+ '102': {"series":"glaze","zh":"湖蓝","en":"Glaze · Blue","base":["#58b7eb","#2c98e2","#2674da","#2939bf"],"material":"blueglaze"},
32
+ '103': {"series":"glaze","zh":"翡翠绿","en":"Glaze · Jade","base":["#40c49b","#40c49b","#12856c","#086953"],"material":"jadeglaze"},
33
+ '104': {"series":"glaze","zh":"莓果粉","en":"Glaze · Berry","base":["#ec77ac","#ec77ac","#c13b7b","#9e285f"],"material":"berryglaze"},
34
+ '105': {"series":"glaze","zh":"琥珀橙","en":"Glaze · Amber","base":["#f4b053","#f4b053","#db762b","#ae531b"],"material":"amberglaze"},
35
+ '106': {"series":"glaze","zh":"鸢尾紫","en":"Glaze · Iris","base":["#aa83ef","#aa83ef","#7846cf","#5831a8"],"material":"irisglaze"},
36
+ '201': {"series":"ice","zh":"冰透蓝","en":"Ice glass · Blue","base":["#d5e4f5","#bfd2e9","#a9c2de","#8ba9cb"],"material":"iceglaze"},
37
+ '202': {"series":"ice","zh":"冰透薄荷绿","en":"Ice glass · Mint","base":["#d7f0e5","#d7f0e5","#b3d8c9","#8bbcae"],"material":"mintice"},
38
+ '203': {"series":"ice","zh":"冰透樱花粉","en":"Ice glass · Blush","base":["#f5dfe9","#f5dfe9","#e2bed0","#c093ab"],"material":"blushice"},
39
+ '204': {"series":"ice","zh":"冰透香槟金","en":"Ice glass · Champagne","base":["#f4e9d2","#f4e9d2","#e0cda8","#c2ac81"],"material":"champagneice"},
40
+ '205': {"series":"ice","zh":"冰透薰衣紫","en":"Ice glass · Lavender","base":["#e8e1f6","#e8e1f6","#cec1e8","#a89ac9"],"material":"lavenderice"},
41
+ '206': {"series":"ice","zh":"冰透霜白","en":"Ice glass · White","base":["#f6fbff","#f6fbff","#dce8ef","#c0cdd6"],"material":"whiteice"},
42
+ '301': {"series":"gummy","zh":"软糖 · 蓝","en":"Gummy · Blue","base":["#90b9fe","#619bff","#4287ff","#5295ff"],"native":"glow-blue"},
43
+ '302': {"series":"gummy","zh":"软糖 · 红","en":"Gummy · Red","base":["#fe9590","#ff6961","#ff4c42","#ff5752"],"native":"glow-red"},
44
+ '303': {"series":"gummy","zh":"软糖 · 嫩绿","en":"Gummy · Lime","base":["#b9ff94","#92ec55","#72d232","#57c200"],"native":"custom-1793262923292"},
45
+ '304': {"series":"gummy","zh":"软糖 · 紫","en":"Gummy · Purple","base":["#ca90fe","#b561ff","#a742ff","#ab52ff"],"native":"glow-purple"},
46
+ '305': {"series":"gummy","zh":"软糖 · 粉","en":"Gummy · Pink","base":["#fe90c8","#ff61b0","#ff42a0","#ff52ac"],"native":"glow-pink"},
47
+ '306': {"series":"gummy","zh":"软糖 · 橙","en":"Gummy · Orange","base":["#febb89","#ffa159","#ff8f39","#ff9449"],"native":"glow-orange"},
48
+ '307': {"series":"gummy","zh":"软糖 · 淡蓝","en":"Gummy · Light Blue","base":["#90d4fe","#80d9ff","#4dc9ff","#38a9ff"],"native":"custom-1793262553386"},
49
+ '308': {"series":"gummy","zh":"软糖 · 灰","en":"Gummy · Gray","base":["#b9cad4","#9bb8c5","#8198a2","#8a959e"],"native":"custom-1793262790531"},
50
+ '309': {"series":"gummy","zh":"软糖 · 粉红","en":"Gummy · Rose","base":["#ff94fb","#ff1f1f","#fe5881","#c20000"],"native":"custom-1793263007260"},
51
+ '310': {"series":"gummy","zh":"软糖 · 蓝绿","en":"Gummy · Teal","base":["#47c8ff","#27ecbb","#30cfb4","#0f4bff"],"native":"custom-1793263221394"},
52
+ '311': {"series":"gummy","zh":"软糖 · 黄","en":"Gummy · Yellow","base":["#ffe014","#ffd642","#ffbd2e","#ffd35c"],"native":"custom-1793263313834"},
53
+ '312': {"series":"gummy","zh":"软糖 · 绿","en":"Gummy · Green","base":["#90d89e","#61c876","#42bd5b","#52c267"],"native":"glow-green"},
54
+ '401': {"series":"candy","zh":"糖果蓝","en":"Candy glass · Blue","base":["#2e7bff","#337aff","#0056f5","#023bca"],"native":"gem-blue"},
55
+ '402': {"series":"candy","zh":"糖果红","en":"Candy glass · Red","base":["#ff312e","#ff3a33","#f50700","#ca1502"],"native":"gem-red"},
56
+ '403': {"series":"candy","zh":"糖果绿","en":"Candy glass · Green","base":["#14ce29","#15d42e","#0f9620","#0d7621"],"native":"gem-green"},
57
+ '404': {"series":"candy","zh":"糖果紫","en":"Candy glass · Purple","base":["#992eff","#a033ff","#8200f5","#7902ca"],"native":"gem-purple"},
58
+ '405': {"series":"candy","zh":"糖果粉红","en":"Candy glass · Pink","base":["#ff2e94","#ff3392","#f50073","#ca0253"],"native":"gem-pink"},
59
+ '406': {"series":"candy","zh":"糖果橙","en":"Candy glass · Orange","base":["#ff7f25","#ff862a","#eb6500","#c16102"],"native":"gem-orange"},
60
+ '501': {"series":"acrylic","zh":"亮光蓝","en":"Acrylic · Gloss Blue","base":["#5a9dff","#2f7cf6","#286fea","#1c5ed8"],"native":"gleam-blue"},
61
+ '502': {"series":"acrylic","zh":"亮光红","en":"Acrylic · Gloss Red","base":["#ff5c5a","#f6362f","#ea3328","#d8291c"],"native":"gleam-red"},
62
+ '503': {"series":"acrylic","zh":"亮光绿","en":"Acrylic · Gloss Green","base":["#2cea41","#1bbf31","#20a434","#1e8630"],"native":"gleam-green"},
63
+ '504': {"series":"acrylic","zh":"亮光黄","en":"Acrylic · Gloss Yellow","base":["#ffe35a","#f6d82f","#ead128","#d8c31c"],"native":"gleam-yellow"},
64
+ '505': {"series":"acrylic","zh":"亮光紫","en":"Acrylic · Gloss Purple","base":["#af5aff","#992ff6","#9428ea","#871cd8"],"native":"gleam-purple"},
65
+ '506': {"series":"acrylic","zh":"亮光粉","en":"Acrylic · Gloss Pink","base":["#ff5ab0","#f62f92","#ea2885","#d81c73"],"native":"gleam-pink"},
66
+ '507': {"series":"acrylic","zh":"清透蓝","en":"Acrylic · Clear Blue","base":["#75acff","#428eff","#337aff","#001442"],"native":"clear-blue"},
67
+ '508': {"series":"acrylic","zh":"清透红","en":"Acrylic · Clear Red","base":["#ff7a75","#ff4842","#ff4533","#420900"],"native":"clear-red"},
68
+ '509': {"series":"acrylic","zh":"清透绿","en":"Acrylic · Clear Green","base":["#48ed5f","#16e332","#15d439","#010d04"],"native":"clear-green"},
69
+ '510': {"series":"acrylic","zh":"清透紫","en":"Acrylic · Clear Purple","base":["#bf75ff","#a742ff","#ab33ff","#2a0042"],"native":"clear-purple"},
70
+ '511': {"series":"acrylic","zh":"清透粉红","en":"Acrylic · Clear Pink","base":["#ff75b5","#ff429a","#ff3387","#420018"],"native":"clear-pink"},
71
+ '512': {"series":"acrylic","zh":"清透橙","en":"Acrylic · Clear Orange","base":["#ffad6d","#ff8f39","#ff922a","#3c2000"],"native":"clear-orange"},
72
+ '601': {"series":"jelly","zh":"果冻蓝","en":"Jelly · Blue","base":["#3cabec","#2a67d0","#1e3cb4","#12228a"],"native":"slab-blue"},
73
+ '602': {"series":"jelly","zh":"果冻红","en":"Jelly · Red","base":["#ec3c64","#d0302a","#b43c1e","#8a3212"],"native":"slab-red"},
74
+ '603': {"series":"jelly","zh":"果冻绿","en":"Jelly · Green","base":["#a6ec3c","#62d02a","#38b41e","#1e8a12"],"native":"slab-green"},
75
+ '604': {"series":"jelly","zh":"果冻紫","en":"Jelly · Purple","base":["#6b3cec","#832ad0","#871eb4","#6e128a"],"native":"slab-purple"},
76
+ '605': {"series":"jelly","zh":"果冻粉","en":"Jelly · Pink","base":["#ec3cc3","#d02a7d","#b41e50","#8a1232"],"native":"slab-pink"},
77
+ '606': {"series":"jelly","zh":"果冻橙","en":"Jelly · Orange","base":["#f1856f","#de9259","#dc962e","#b68218"],"native":"slab-orange"},
78
+ '607': {"series":"jelly","zh":"渐变靛","en":"Jelly · Prism Indigo","base":["#3f81f0","#4034c9","#bb30e8","#ff1f8b"],"native":"prism-indigo"},
79
+ '608': {"series":"jelly","zh":"渐变红","en":"Jelly · Prism Red","base":["#f03f8a","#c93934","#e8b230","#97ff1f"],"native":"prism-red"},
80
+ '609': {"series":"jelly","zh":"渐变青柠","en":"Jelly · Prism Lime","base":["#cfe537","#6ab237","#29dc57","#18eff3"],"native":"prism-lime"},
81
+ '610': {"series":"jelly","zh":"渐变玫红","en":"Jelly · Prism Rose","base":["#f03fbc","#c93459","#e87e30","#d6ff1f"],"native":"prism-rose"},
82
+ '611': {"series":"jelly","zh":"渐变天蓝","en":"Jelly · Prism Sky","base":["#3ff0da","#3497c9","#3130e8","#cb1fff"],"native":"prism-sky"},
83
+ '612': {"series":"jelly","zh":"渐变紫","en":"Jelly · Prism Purple","base":["#9a3ff0","#c534c9","#e83071","#ff7a1f"],"native":"prism-purple"},
84
+ '701': {"series":"gradient","zh":"海洋","en":"Gradient · Ocean","base":["#7ff0e4","#3cc3e0","#2b7fd4","#3b3fb0"],"native":"ocean"},
85
+ '702': {"series":"gradient","zh":"森林","en":"Gradient · Forest","base":["#d9f99d","#7bd389","#2f9e7a","#1e5f6b"],"native":"forest"},
86
+ '703': {"series":"gradient","zh":"渐变 · 黄","en":"Gradient · Yellow","base":["#f0bf7f","#e0c73c","#b6d42b","#65b03b"],"native":"gradient-yellow"},
87
+ '704': {"series":"gradient","zh":"渐变 · 紫","en":"Gradient · Purple","base":["#a29aeb","#c592f1","#eb95cf","#e7c49b"],"native":"gradient-purple"},
88
+ '705': {"series":"gradient","zh":"糖果","en":"Gradient · Candy","base":["#ffe1f0","#ff9cc8","#b18cff","#7fd4ff"],"native":"candy"},
89
+ '706': {"series":"gradient","zh":"流光","en":"Gradient · Aurora","base":["#9aebea","#92c9f1","#a795eb","#e79bc7"],"native":"aurora"},
90
+ '707': {"series":"gradient","zh":"珍珠","en":"Gradient · Pearl","base":["#ffffff","#eaf2ff","#f4e9ff","#e2f6ee"],"native":"pearl"},
91
+ '708': {"series":"gradient","zh":"樱花","en":"Gradient · Sakura","base":["#ffffff","#fdeaf0","#f3c7d4","#d697ab"],"native":"sakura"},
92
+ '709': {"series":"gradient","zh":"薰衣草","en":"Gradient · Lavender","base":["#ffffff","#ece6ff","#cbbcf2","#9c88d6"],"native":"lavender"},
93
+ '710': {"series":"gradient","zh":"柠檬","en":"Gradient · Lemon","base":["#fffef0","#fff2a8","#f5d757","#c9a21d"],"native":"lemon"},
94
+ '711': {"series":"gradient","zh":"天空","en":"Gradient · Sky","base":["#ffffff","#dff1ff","#a9d6f7","#5ea4d8"],"native":"sky"},
95
+ '712': {"series":"gradient","zh":"薄荷","en":"Gradient · Mint","base":["#f5fffb","#cdf3e5","#93dcc3","#52ad90"],"native":"mint"},
96
+ '801': {"series":"frosted","zh":"雾白透银","en":"Frosted glass · Mist","base":["#ffffff","#eff5f7","#d8e4ea","#b3c5d0"],"material":"clearwhite"},
97
+ '802': {"series":"frosted","zh":"透光液态银","en":"Frosted glass · Silver","base":["#fcfaf6","#d3dbdf","#98a6ae","#66767f"],"material":"clearsilver"},
98
+ '803': {"series":"frosted","zh":"厚底透银","en":"Frosted glass · Weighted","base":["#fcfaf6","#d3dbdf","#98a6ae","#66767f"],"material":"clearweighted"},
99
+ '804': {"series":"frosted","zh":"硬光透银","en":"Frosted glass · Hard Light","base":["#fcfaf6","#d3dbdf","#98a6ae","#66767f"],"material":"clearhard"},
100
+ '805': {"series":"frosted","zh":"烟灰透银","en":"Frosted glass · Smoke","base":["#dce5e9","#abbac3","#778e9d","#485f70"],"material":"clearsmoke"},
101
+ '806': {"series":"frosted","zh":"墨灰透银","en":"Frosted glass · Ink","base":["#bacbd6","#7e97a8","#4b687e","#2a4257"],"material":"clearink"},
102
+ '901': {"series":"metal","zh":"液态金","en":"Metal · Liquid Gold","base":["#fcfbf6","#f0e4c5","#dcc37d","#c69f35"],"material":"golddrop"},
103
+ '902': {"series":"metal","zh":"钛金","en":"Metal · Titanium Gold","base":["#f6e1b8","#d4a446","#a57009","#704a00"],"material":"deepmetalgold"},
104
+ '903': {"series":"metal","zh":"深玫瑰金","en":"Metal · Deep Rose Gold","base":["#fcdcd9","#e19991","#b3645b","#833f38"],"material":"deepmetalrose"},
105
+ '904': {"series":"metal","zh":"深铜","en":"Metal · Deep Copper","base":["#f0ded4","#d29c7e","#ac663d","#734428"],"material":"copperdeep"},
106
+ '905': {"series":"metal","zh":"红铜","en":"Metal · Red Copper","base":["#ffddc9","#ec9969","#c0652f","#8d4012"],"material":"deepmetalcopper"},
107
+ '906': {"series":"metal","zh":"星宇橙","en":"Metal · Cosmic Orange","base":["#ffdecc","#ff9962","#e3611c","#ae3d01"],"material":"iphonecosmicorange"},
108
+ '907': {"series":"metal","zh":"青铜","en":"Metal · Bronze","base":["#e8e5bc","#b5ac51","#827a14","#585100"],"material":"deepmetalbronze"},
109
+ '908': {"series":"metal","zh":"黑钛","en":"Metal · Black Titanium","base":["#dbe4ee","#97aac2","#627791","#3d4f66"],"material":"deepmetaltitanium"},
110
+ '909': {"series":"metal","zh":"铂金白","en":"Metal · Platinum White","base":["#eff0f2","#cacdd2","#a5aab0","#848990"],"material":"deepmetalplatinum"},
111
+ '910': {"series":"metal","zh":"浅香槟","en":"Metal · Champagne","base":["#f1eadc","#cebb97","#a78f61","#816a3c"],"material":"deepmetalchampagne"},
112
+ '911': {"series":"metal","zh":"冰蓝钛","en":"Metal · Ice Blue","base":["#d4ecf8","#86bfdc","#4d92b6","#2a6b8d"],"material":"deepmetaliceblue"},
113
+ '912': {"series":"metal","zh":"群青","en":"Metal · Ultramarine","base":["#dae0ff","#8ea0ff","#576bd6","#34459c"],"material":"iphoneultramarine"},
114
+ '913': {"series":"metal","zh":"紫钛","en":"Metal · Violet","base":["#efd8ff","#ce88ff","#9e4fd5","#6c2e98"],"material":"deepmetalviolet"},
115
+ '914': {"series":"metal","zh":"勃艮第酒红","en":"Metal · Burgundy","base":["#fbbfd3","#be5f7e","#702b42","#38131f"],"material":"iphoneburgundy"},
116
+ '915': {"series":"metal","zh":"深青","en":"Metal · Teal","base":["#cdeae9","#76bab7","#3d8986","#1d605e"],"material":"iphoneteal"},
117
+ '916': {"series":"metal","zh":"深墨绿","en":"Metal · Forest","base":["#bad4ca","#588272","#26453a","#10221b"],"material":"deepmetalforest"},
118
+ '917': {"series":"metal","zh":"原色钛","en":"Metal · Natural Titanium","base":["#eceae7","#c1bcb4","#969085","#716b60"],"material":"iphonenatural"},
119
+ '918': {"series":"metal","zh":"暗紫","en":"Metal · Deep Purple","base":["#d7ccdc","#86748f","#4a3c50","#251d28"],"material":"iphonedeepurple"},
120
+ '919': {"series":"metal","zh":"浅粉","en":"Metal · Pink","base":["#f8eff1","#e5ccd1","#cda8b0","#b28890"],"material":"iphonepink"},
121
+ '920': {"series":"metal","zh":"鼠尾草绿","en":"Metal · Sage","base":["#e8ece4","#b8c2ac","#8b987b","#667357"],"material":"iphonesage"},
122
+ '921': {"series":"metal","zh":"薰衣草紫","en":"Metal · Lavender","base":["#eeebf6","#c8bfdb","#a095ba","#7d7198"],"material":"iphonelavender"},
123
+ '922': {"series":"metal","zh":"铂金银","en":"Metal · Platinum","base":["#bcc0c4","#7e868e","#5b6269","#44494e"],"material":"satinplatinum"},
124
+ '923': {"series":"metal","zh":"玫瑰金","en":"Metal · Rose Gold","base":["#d5aca1","#ac604d","#774235","#512d24"],"material":"satinrose"},
125
+ '924': {"series":"metal","zh":"暖红铜","en":"Metal · Warm Copper","base":["#dba483","#a65c30","#6a3a1f","#412413"],"material":"satinredcopper"},
126
+ '925': {"series":"metal","zh":"暖青铜","en":"Metal · Warm Bronze","base":["#c6b680","#7f6f39","#4d4322","#2d2714"],"material":"satinbronze"},
127
+ '926': {"series":"metal","zh":"枪灰钛","en":"Metal · Gunmetal","base":["#7a8a9b","#353e46","#1a1e22","#0c0e10"],"material":"satingunmetal"},
128
+ '927': {"series":"metal","zh":"亮银","en":"Metal · Bright Silver","base":["#ffffff","#f0f3f3","#d5dee2","#a5b5bf"],"material":"silverbright"},
129
+ '928': {"series":"metal","zh":"液态银","en":"Metal · Liquid Silver","base":["#fcfaf6","#d5dde0","#a3afb6","#71818a"],"material":"silverdrop"},
130
+ '929': {"series":"metal","zh":"深银","en":"Metal · Deep Silver","base":["#dce4e8","#9baab4","#657784","#3d505e"],"material":"silverdeep"},
131
+ '930': {"series":"metal","zh":"石墨银","en":"Metal · Graphite","base":["#aabac5","#647987","#3b505f","#213440"],"material":"silvergraphite"},
132
+ '1001': {"series":"gem","zh":"黑曜石","en":"Gems · Obsidian","base":["#7b8796","#313a47","#101722","#05080e"],"native":"obsidian"},
133
+ '1002': {"series":"gem","zh":"午夜蓝","en":"Gems · Midnight","base":["#7f98d4","#2c4381","#111e4a","#060b22"],"native":"midnight"},
134
+ '1003': {"series":"gem","zh":"墨玉","en":"Gems · Jade","base":["#7fb5a3","#2f6d5b","#123e33","#06201a"],"native":"jade"},
135
+ '1004': {"series":"gem","zh":"琥珀","en":"Gems · Amber","base":["#ffe2a6","#f2a73c","#c46812","#6b3005"],"native":"amber"},
136
+ '1005': {"series":"gem","zh":"红宝石","en":"Gems · Ruby","base":["#ff8a9a","#d0243f","#7a0d22","#3a0410"],"native":"ruby"},
137
+ '1006': {"series":"gem","zh":"蓝宝石","en":"Gems · Sapphire","base":["#8fc0ff","#2a6fd6","#103f8c","#071d44"],"native":"sapphire"},
138
+ '1007': {"series":"gem","zh":"祖母绿","en":"Gems · Emerald","base":["#8ff0c0","#1fae74","#0b6a45","#033321"],"native":"emerald"},
139
+ '1008': {"series":"gem","zh":"曜石釉","en":"Gems · Obsidian","base":["#7b8796","#313a47","#101722","#05080e"],"material":"obsidian"},
140
+ '1009': {"series":"gem","zh":"白瓷","en":"Gems · Porcelain","base":["#ffffff","#f5f4ec","#d9dad3","#a3aaab"],"material":"porcelain"},
141
+ '1010': {"series":"gem","zh":"磨砂陶土","en":"Gems · Clay","base":["#e6b59a","#d9997d","#c58065","#ad674e"],"material":"clay"},
142
+ '1011': {"series":"gem","zh":"彩色水磨石","en":"Gems · Terrazzo","base":["#fff9ed","#f1e7d7","#e1d3c1","#cab9a8"],"material":"terrazzo"},
143
+ '1012': {"series":"gem","zh":"青花小瓷","en":"Gems · Blue Floral","base":["#fffaf0","#eee5d3","#d5c5aa","#b5a58b"],"material":"ceramicblue"},
144
+ '1101': {"series":"wood","zh":"浅枫木","en":"Wood · Maple","base":["#f7e8ca","#e4c999","#c9a575","#a87d50"],"material":"woodmaple"},
145
+ '1102': {"series":"wood","zh":"暖橡木","en":"Wood · Oak","base":["#efd3a0","#cea065","#ad7844","#82532e"],"material":"woodoak"},
146
+ '1103': {"series":"wood","zh":"深胡桃木","en":"Wood · Walnut","base":["#b58d67","#865b3c","#5e3b28","#38251c"],"material":"woodwalnut"},
147
+ '1104': {"series":"wood","zh":"红木","en":"Wood · Rosewood","base":["#cf9376","#a65d42","#773d2c","#48251e"],"material":"woodrose"},
148
+ '1105': {"series":"wood","zh":"黑檀木","en":"Wood · Ebony","base":["#696052","#42382d","#2a221c","#171411"],"material":"woodebony"},
149
+ '1106': {"series":"wood","zh":"软木积木","en":"Wood · Cork","base":["#e8cb99","#cfad76","#b99159","#9c7646"],"material":"cork"},
150
+ '1201': {"series":"ball","zh":"足球 · 沟槽","en":"Balls · Soccer","base":["#4a4d55","#24262b","#131417","#060607"],"native":"soccer-grooves"},
151
+ '1202': {"series":"ball","zh":"橘子篮球","en":"Balls · Orange Basketball","base":["#ffbd63","#ed8836","#d26320","#93421c"],"material":"basketball"},
152
+ '1203': {"series":"ball","zh":"篮球","en":"Balls · Basketball","base":["#ffb066","#f07a1e","#c95a0e","#7a3305"],"native":"basketball"},
153
+ '1204': {"series":"ball","zh":"橄榄球","en":"Balls · Football","base":["#c07a4a","#8f4a22","#6a3112","#3a1606"],"native":"football"},
154
+ '1205': {"series":"ball","zh":"网球","en":"Balls · Tennis","base":["#f4ff8a","#d7f43a","#aacb10","#66800a"],"native":"tennis"},
155
+ '1206': {"series":"ball","zh":"棒球","en":"Balls · Baseball","base":["#fffdf7","#f6f1e6","#e2d9c7","#b5a98f"],"native":"baseball"},
156
+ '1207': {"series":"ball","zh":"经典棒球","en":"Balls · Classic Baseball","base":["#fffdf4","#f3eee0","#e2dccb","#bfb7a4"],"material":"baseball"},
157
+ '1208': {"series":"ball","zh":"垒球","en":"Balls · Softball","base":["#fbff9a","#eef55a","#cfd61f","#8a8f0a"],"native":"softball"},
158
+ '1209': {"series":"ball","zh":"板球","en":"Balls · Cricket","base":["#e05a4f","#b52a22","#851812","#470806"],"native":"cricket"},
159
+ '1210': {"series":"ball","zh":"高尔夫","en":"Balls · Golf","base":["#ffffff","#f6f6f4","#e2e2de","#acaca6"],"native":"golf"},
160
+ '1301': {"series":"gloss","zh":"流光彩色","en":"Clear · Aurora","base":["#9aebea","#92c9f1","#a795eb","#e79bc7"],"material":"aurora"},
161
+ '1302': {"series":"gloss","zh":"贝壳珍珠","en":"Clear · Nacre","base":["#fff8eb","#ecd8e6","#c6ddd8","#b5afcf"],"material":"pearl"},
162
+ '1303': {"series":"gloss","zh":"镭射糖纸","en":"Clear · Hologram","base":["#88e9df","#c5b6f5","#f6b8d0","#f5ebad","#9adce0"],"material":"hologram"},
163
+ '1304': {"series":"gloss","zh":"冰川水晶","en":"Clear · Glacier","base":["#f0ffff","#b6e9f2","#71b9d4","#437baf"],"material":"ice"},
164
+ '1305': {"series":"gloss","zh":"彩虹泡泡","en":"Clear · Bubble","base":["#f9eafa","#bfe6ed","#ded1f0","#bad9e6"],"material":"soap"},
165
+ '1401': {"series":"fabric","zh":"复古牛仔","en":"Fabric · Denim","base":["#698ba3","#456d8b","#315775","#244460"],"material":"denim"},
166
+ '1402': {"series":"fabric","zh":"焦糖皮革","en":"Fabric · Leather","base":["#c79665","#ab784c","#8f5d38","#6a432b"],"material":"leather"},
167
+ '1403': {"series":"fabric","zh":"莓果毛衣","en":"Fabric · Knit","base":["#d5a4b6","#b5809b","#925d7c","#70465f"],"material":"knit"},
168
+ '1404': {"series":"fabric","zh":"午夜蕾丝","en":"Fabric · Lace","base":["#4d526f","#353a57","#252b46","#1c2138"],"material":"lace"},
169
+ '1405': {"series":"fabric","zh":"苏格兰格纹","en":"Fabric · Tartan","base":["#ffbcc7","#ef899e","#d86383","#b34364"],"material":"tartan"},
170
+ '1406': {"series":"fabric","zh":"菱格背心","en":"Fabric · Argyle","base":["#e4d6ef","#bcabd5","#9a88bc","#776397"],"material":"argyle"},
171
+ '1407': {"series":"fabric","zh":"靛蓝刺子绣","en":"Fabric · Sashiko","base":["#546b8b","#394f71","#273b5b","#1a2a43"],"material":"sashiko"},
172
+ '1408': {"series":"fabric","zh":"拼布小被","en":"Fabric · Patchwork","base":["#ffe7db","#f3bfb9","#df969f","#bd738c"],"material":"quilt"},
173
+ '1409': {"series":"fabric","zh":"灯芯绒衣","en":"Fabric · Corduroy","base":["#ffd5a0","#f5b267","#de8941","#b5672d"],"material":"corduroy"},
174
+ '1410': {"series":"fabric","zh":"亚麻布袋","en":"Fabric · Linen","base":["#fffaf0","#eee5d3","#d5c5aa","#b5a58b"],"material":"linen"},
175
+ '1411': {"series":"fabric","zh":"苏格兰格","en":"Fabric · Plaid","base":["#d04848","#a82d30","#7d1c20","#4a0e12"],"native":"tartan"},
176
+ '1412': {"series":"fabric","zh":"竹编小篮","en":"Fabric · Bamboo","base":["#e7d49b","#ceb574","#b79b5b","#937a40"],"material":"bamboo"},
177
+ '1501': {"series":"food","zh":"糖果条纹","en":"Sweets · Candy Stripe","base":["#ffd5df","#f4a2bf","#e782a7","#c85d89"],"material":"candy"},
178
+ '1502': {"series":"food","zh":"奶牛软糖","en":"Sweets · Milk Candy","base":["#fffdf5","#f4f0e6","#deded5","#bfc8c6"],"material":"cow"},
179
+ '1503': {"series":"food","zh":"西瓜汽水","en":"Sweets · Watermelon","base":["#ffb5ad","#f68d8f","#e9747f","#cc5267"],"material":"watermelon"},
180
+ '1504': {"series":"food","zh":"草莓奶冻","en":"Sweets · Strawberry","base":["#ffbcc7","#ef899e","#d86383","#b34364"],"material":"strawberry"},
181
+ '1505': {"series":"food","zh":"奇异果切片","en":"Sweets · Kiwi","base":["#e2efb0","#bdd574","#94b94e","#627f35"],"material":"kiwi"},
182
+ '1506': {"series":"food","zh":"柠檬切片","en":"Sweets · Lemon","base":["#fff3ac","#f6d657","#eab62c","#c58c22"],"material":"lemon"},
183
+ '1507': {"series":"food","zh":"橘皮软糖","en":"Sweets · Orange Peel","base":["#ffd5a0","#f5b267","#de8941","#b5672d"],"material":"orangepeel"},
184
+ '1508': {"series":"food","zh":"火龙果点点","en":"Sweets · Dragon Fruit","base":["#fffefa","#f6f4ec","#e6e4df","#c4cccb"],"material":"dragonfruit"},
185
+ '1509': {"series":"food","zh":"巧克力方砖","en":"Sweets · Chocolate","base":["#b38a69","#8a6046","#6a4334","#493027"],"material":"chocolate"},
186
+ '1510': {"series":"food","zh":"蜂格华夫","en":"Sweets · Waffle","base":["#ffd5a0","#f5b267","#de8941","#b5672d"],"material":"waffle"},
187
+ '1511': {"series":"food","zh":"曲奇碎碎","en":"Sweets · Cookie","base":["#fff2a4","#efcf61","#d9a438","#b97b25"],"material":"cookie"},
188
+ '1512': {"series":"food","zh":"糖针甜甜圈","en":"Sweets · Sprinkles","base":["#ffbcc7","#ef899e","#d86383","#b34364"],"material":"donut"},
189
+ '1601': {"series":"nature","zh":"大理石","en":"Nature · Marble","base":["#ffffff","#f6f6f4","#e6e6e2","#bcbcb6"],"native":"marble"},
190
+ '1602': {"series":"nature","zh":"黑金大理石","en":"Nature · Black Marble","base":["#4a4a4f","#25252a","#141417","#050506"],"native":"black-marble"},
191
+ '1603': {"series":"nature","zh":"树叶","en":"Nature · Leaves","base":["#f0fbe6","#cfeeb2","#97d37b","#4f9a45"],"native":"leaves"},
192
+ '1604': {"series":"nature","zh":"樱瓣","en":"Nature · Blossoms","base":["#fffafd","#ffeaf2","#ffd0e0","#f0a3c0"],"native":"blossoms"},
193
+ '1605': {"series":"nature","zh":"仙人掌球","en":"Nature · Cactus","base":["#d4e6a0","#a9c568","#7f9d47","#597538"],"material":"cactus"},
194
+ '1606': {"series":"nature","zh":"口袋星空","en":"Nature · Galaxy","base":["#6545ad","#45277f","#193b70","#101b3a"],"material":"galaxy"},
195
+ '1607': {"series":"nature","zh":"青芽绒绒","en":"Nature · Sprout","base":["#d1ef9b","#96c953","#6ba737","#3e6e29"],"material":"matcharib"},
196
+ '1608': {"series":"nature","zh":"云朵棉花","en":"Nature · Clouds","base":["#b5e0f2","#86bfe0","#5f9bc9","#3e73a4"],"material":"cloud"},
197
+ '1609': {"series":"nature","zh":"青海波纹","en":"Nature · Waves","base":["#5b7fa5","#3f648e","#2b4c77","#20395d"],"material":"wave"},
198
+ '1610': {"series":"nature","zh":"雨窗水滴","en":"Nature · Raindrops","base":["#dbd9d0","#b9bbb4","#919a97","#6b7b7c"],"material":"raindrop"},
199
+ '1611': {"series":"nature","zh":"雪花毛毯","en":"Nature · Snowflakes","base":["#546b8b","#394f71","#273b5b","#1a2a43"],"material":"snowflake"},
200
+ '1612': {"series":"nature","zh":"霓虹","en":"Nature · Neon","base":["#5b3df5","#2a1673","#120a3a","#06041a"],"native":"neon"},
201
+ '1701': {"series":"pattern","zh":"奶油波点","en":"Patterns · Cream Dots","base":["#af9beb","#8c72d9","#7860c4","#5a469e"],"material":"polka"},
202
+ '1702': {"series":"pattern","zh":"碳纤维","en":"Patterns · Carbon","base":["#4a5557","#2c3639","#1b2428","#10191e"],"material":"carbon"},
203
+ '1703': {"series":"pattern","zh":"工程蓝图","en":"Patterns · Blueprint","base":["#6a9ed4","#477ebc","#2d609f","#244a85"],"material":"blueprint"},
204
+ '1704': {"series":"pattern","zh":"折纸山谷","en":"Patterns · Origami","base":["#f5e5d3","#e6c7b0","#b9c7c1","#a0a8bb"],"material":"origami"},
205
+ '1705': {"series":"pattern","zh":"电路精灵","en":"Patterns · Circuit","base":["#3c6c61","#235347","#163b34","#102b29"],"material":"circuit"},
206
+ '1706': {"series":"pattern","zh":"森林迷彩","en":"Patterns · Camo","base":["#b0b594","#8e9e75","#71835e","#4c6247"],"material":"camo"},
207
+ '1707': {"series":"pattern","zh":"等高线地图","en":"Patterns · Topo","base":["#7dbbb6","#519a98","#347b80","#235d68"],"material":"topo"},
208
+ '1708': {"series":"pattern","zh":"金线扇影","en":"Patterns · Art Deco","base":["#546b8b","#394f71","#273b5b","#1a2a43"],"material":"artdeco"},
209
+ '1709': {"series":"pattern","zh":"孟菲斯派对","en":"Patterns · Memphis","base":["#e4d6ef","#bcabd5","#9a88bc","#776397"],"material":"memphis"},
210
+ '1710': {"series":"pattern","zh":"彩色人字纹","en":"Patterns · Chevron","base":["#f3e8cd","#e4d5b3","#c8b48f","#9e8e70"],"material":"chevron"},
211
+ '1711': {"series":"pattern","zh":"六角装甲","en":"Patterns · Hex Armor","base":["#dbd9d0","#b9bbb4","#919a97","#6b7b7c"],"material":"hexbolt"},
212
+ '1712': {"series":"pattern","zh":"铆钉机甲","en":"Patterns · Rivets","base":["#546b8b","#394f71","#273b5b","#1a2a43"],"material":"rivet"},
213
+ '1713': {"series":"pattern","zh":"波点","en":"Patterns · Polka","base":["#ff9db2","#ff5d84","#e03a64","#9b1c3e"],"native":"polka"},
214
+ '1714': {"series":"pattern","zh":"彩纸","en":"Patterns · Confetti","base":["#ffffff","#fbfaf7","#efece6","#c9c4bb"],"native":"confetti"},
215
+ '1715': {"series":"pattern","zh":"网点","en":"Patterns · Halftone","base":["#ffe6ee","#ffb3c7","#ff7aa0","#d6406c"],"native":"halftone"},
216
+ '1716': {"series":"pattern","zh":"水磨石","en":"Patterns · Terrazzo","base":["#ffffff","#fbfaf7","#efece6","#c9c4bb"],"native":"terrazzo"},
217
+ '1717': {"series":"pattern","zh":"像素","en":"Patterns · Pixel","base":["#3a3a4a","#24242f","#16161d","#0a0a10"],"native":"pixel"},
218
+ };
@@ -0,0 +1,118 @@
1
+ // Each texture here has its own SVG artwork.
2
+ const COLLECTION = new Set(['ceramicblue', 'tartan', 'argyle', 'sashiko', 'quilt', 'corduroy', 'linen', 'strawberry', 'orangepeel', 'chocolate', 'waffle', 'cookie', 'donut', 'cactus', 'raindrop', 'snowflake', 'artdeco', 'memphis', 'hexbolt', 'rivet']);
3
+
4
+ export function collectionTexture(defs,id,kind,el,gradient) {
5
+ if (!COLLECTION.has(kind)) return null;
6
+ const sizes = {kiwi:240,lemon:120,peach:240,chocolate:48,waffle:32,latte:240,malachite:160,agate:160,sandstone:160,ocean:120,cloud:120,tartan:80,houndstooth:32,sashiko:48,corduroy:12,linen:24,hexbolt:48,disco:80,kintsugi:160,opart:160};
7
+ const s=sizes[kind] || 80;
8
+ const p=el('pattern',{id,width:s,height:kind==='hexbolt'?42:s,patternUnits:'userSpaceOnUse'},defs);
9
+ const path=(d,fill='none',stroke='none',width=1,opacity=1,parent=p)=>el('path',{d,fill,stroke,'stroke-width':width,opacity,'stroke-linecap':'round','stroke-linejoin':'round'},parent);
10
+ const circle=(x,y,r,fill,opacity=1,parent=p)=>el('circle',{cx:x,cy:y,r,fill,opacity},parent);
11
+ const rect=(x,y,w,h,fill,opacity=1,rx=0)=>el('rect',{x,y,width:w,height:h,fill,opacity,rx},p);
12
+ const ellipse=(x,y,rx,ry,fill,angle=0,opacity=1,parent=p)=>el('ellipse',{cx:x,cy:y,rx,ry,fill,opacity,transform:`rotate(${angle} ${x} ${y})`},parent);
13
+ const specks=(count,colors,radius=.6)=>{
14
+ for(let i=0;i<count;i++) circle((i*31.71+7)%s,(i*i*13.37+11)%s,radius+(i%3)*.3,colors[i%colors.length],.3);
15
+ };
16
+ if(kind==='strawberry') {
17
+ for(const [x,y] of [[16,18],[55,58],[58,13],[13,57]]) {
18
+ ellipse(x,y,2.1,4,'#9d4d57',-18,.55);ellipse(x-1,y-1,1.3,2.5,'#ffe7a3',-18,.95);
19
+ }
20
+ } else if(kind==='orangepeel') {
21
+ for(let i=0;i<85;i++) {
22
+ const x=(i*21.3)%s,y=(i*i*17.7)%s;
23
+ circle(x,y,1.4,'#b97129',.3);path(`M${x-1} ${y+1}h1.5`,'none','#fff0b9',.7,.5);
24
+ }
25
+ } else if(kind==='chocolate') {
26
+ rect(1,1,46,46,'#432a20',.5,5);rect(5,5,38,38,'#a57652',.5,4);
27
+ path('M7 40V7H40','none','#d4a97d',1.5,.5);path('M41 8V41H8','none','#3d241c',2,.65);
28
+ path('M13 16L24 11 35 16V31L24 36 13 31Z','none','#603b2d',1,.3);
29
+ } else if(kind==='waffle') {
30
+ rect(4,4,24,24,'#a4642e',.5,3);rect(7,7,18,18,'#cc8d42',.7,2);
31
+ path('M4 28V4H28','none','#ffe2a1',3,.75);path('M28 4V28H4','none','#9f602d',2,.55);
32
+ } else if(kind==='cookie') {
33
+ specks(45,['#9f702e','#fff3bb']);
34
+ for(let i=0;i<8;i++) {
35
+ const x=(i*29+8)%s,y=(i*i*17+6)%s;
36
+ path(`M${x} ${y}l6-2 4 5-3 5-7-2Z`,'#604030','none',0,.9);
37
+ path(`M${x+1} ${y}l4-1`,'none','#ac7b56',1,.6);
38
+ }
39
+ } else if(kind==='donut') {
40
+ const colors=['#fff3b2','#8dd4ce','#f6f0ec','#8e82c1','#b64b69'];
41
+ for(let i=0;i<18;i++) {
42
+ const x=(i*31.7)%s,y=(i*i*17.1)%s,a=i*2.3;
43
+ path(`M${x} ${y}l${Math.cos(a)*5} ${Math.sin(a)*5}`,'none',colors[i%5],2.5,.95);
44
+ }
45
+ } else if(kind==='cactus') {
46
+ for(const x of [9,36,63]) {
47
+ path(`M${x} 0q-5 20 0 40t0 40`,'none','#547435',5,.3);
48
+ path(`M${x+4} 0q-5 20 0 40t0 40`,'none','#edf2b6',1.5,.6);
49
+ for(const y of [14,54]) path(`M${x-3} ${y-3}l6 6m-6 0 6-6m-3-1v8`,'none','#fff5cc',1,.85);
50
+ }
51
+ } else if(kind==='raindrop') {
52
+ gradient(defs,'radialGradient',`${id}-drop`,{cx:'.65',cy:'.7'},[[0,'#f4ffff',.65],[.6,'#7d9ba6',.05],[1,'#213d51',.4]]);
53
+ for(const [x,y,r] of [[18,20,8],[55,58,11],[65,12,4],[16,65,4]]) {
54
+ ellipse(x,y,r*.75,r,`url(#${id}-drop)`,-15);
55
+ path(`M${x-r*.4} ${y-r*.4}l1-2`,'none','#fff',1.4,.8);
56
+ }
57
+ } else if(kind==='snowflake') {
58
+ for(const [x,y,r] of [[20,20,16],[60,60,10]]) for(let i=0;i<6;i++) {
59
+ const g=el('g',{transform:`translate(${x} ${y}) rotate(${i*60})`},p);
60
+ path(`M0 0V${-r}M0 ${-r*.5}l${-r*.25} ${-r*.25}M0 ${-r*.5}l${r*.25} ${-r*.25}`,'none','#e5f4f8',1,.8,g);
61
+ }
62
+ specks(12,['#fff'],.5);
63
+ } else if(kind==='tartan') {
64
+ rect(0,0,s,s,'#782f42',.65);
65
+ for(const n of [13,53]) {rect(n,0,15,s,'#224f48',.65);rect(0,n,s,15,'#224f48',.65);}
66
+ for(const n of [8,33,48,73]) path(`M${n} 0v80M0 ${n}h80`,'none','#ead39d',.8,.7);
67
+ } else if(kind==='argyle') {
68
+ path('M20 0L40 40 20 80 0 40Z','#6d5b8e','none',0,.7);path('M60 0L80 40 60 80 40 40Z','#ead6de','none',0,.75);
69
+ path('M0 0L40 80 80 0M0 80L40 0 80 80','none','#fff2d9',1,.75);
70
+ } else if(kind==='sashiko') {
71
+ for(const [x,y] of [[0,0],[48,0],[24,24],[0,48],[48,48]]) el('circle',{cx:x,cy:y,r:24,fill:'none',stroke:'#f4ecdc','stroke-width':1,'stroke-dasharray':'3 2',opacity:.8},p);
72
+ } else if(kind==='quilt') {
73
+ for(const [x,y,c] of [[0,0,'#a6b5b5'],[40,0,'#e3c393'],[0,40,'#d18f94'],[40,40,'#9298b9']]) {
74
+ rect(x,y,40,40,c,.8);
75
+ el('rect',{x:x+3,y:y+3,width:34,height:34,fill:'none',stroke:'#fff4de','stroke-width':1,'stroke-dasharray':'2 2',opacity:.8},p);
76
+ for(const n of [12,28]) circle(x+n,y+n,1.5,'#fff5dd',.7);
77
+ }
78
+ } else if(kind==='corduroy') {
79
+ rect(0,0,3,12,'#73482e',.35);rect(4,0,3,12,'#ffe1aa',.4);
80
+ for(let y=0;y<12;y+=2) path(`M4 ${y}h5`,'none','#fff0c6',.5,.28);
81
+ } else if(kind==='linen') {
82
+ for(let i=1;i<24;i+=3) {
83
+ path(`M${i} 0v24`,'none',i%2?'#8b806a':'#fff8e6',.65,.38);
84
+ path(`M0 ${i}h24`,'none',i%2?'#fff8e6':'#8b806a',.65,.35);
85
+ }
86
+ specks(8,['#716a59'],.4);
87
+ } else if(kind==='artdeco') {
88
+ for(const [x,y] of [[0,80],[80,80],[40,40]]) for(let i=0;i<=8;i++) {
89
+ const a=Math.PI+i*Math.PI/8;
90
+ path(`M${x} ${y}L${x+Math.cos(a)*40} ${y+Math.sin(a)*40}`,'none','#dfc185',.9,.8);
91
+ }
92
+ path('M0 80A40 40 0 0 1 80 80M0 40A40 40 0 0 1 80 40','none','#e5c589',1.5,.8);
93
+ } else if(kind==='memphis') {
94
+ path('M4 18q6-10 12 0t12 0','none','#795c9b',3,.9);
95
+ path('M48 10l16 4-10 13Z','#f2cd79');circle(19,59,7,'#88bcb3');
96
+ path('M46 57l5-5 5 10 5-10 5 5','none','#b36284',2.5,.9);
97
+ for(const [x,y] of [[38,35],[71,41],[6,35]]) circle(x,y,1.5,'#46526d');
98
+ } else if(kind==='hexbolt') {
99
+ for(const [x,y] of [[0,0],[24,0],[48,0],[12,21],[36,21],[0,42],[24,42],[48,42]]) {
100
+ path(`M${x} ${y-14}l12 7v14l-12 7-12-7v-14Z`,'#748786','#354e53',1.5,.7);
101
+ path(`M${x-9} ${y-5}l9-5 9 5`,'none','#e3e9d9',1,.6);
102
+ }
103
+ } else if(kind==='rivet') {
104
+ path('M0 0H80V80H0Z','none','#132235',3,.65);path('M3 77V3H77','none','#9cb0c0',1,.55);
105
+ for(const [x,y] of [[9,9],[71,9],[9,71],[71,71]]) {
106
+ circle(x,y,3.5,'#172b3d',.8);circle(x-1,y-1,2.5,'#afbec5',.85);
107
+ path(`M${x-2} ${y-2}h2`,'none','#f2f6ee',.8,.9);
108
+ }
109
+ } else if(kind==='ceramicblue') {
110
+ for(const [x,y] of [[20,22],[61,61]]) {
111
+ const g=el('g',{transform:`translate(${x} ${y})`},p);
112
+ for(let i=0;i<6;i++) el('ellipse',{cx:0,cy:-6,rx:3,ry:7,fill:'#4c7097',opacity:.8,transform:`rotate(${i*60})`},g);
113
+ circle(0,0,2,'#e5ebdf',1,g);
114
+ path('M5 14Q22 28 18 40M10 22q10-13 15-3q-3 8-15 3','none','#416d94',1.2,.9,g);
115
+ }
116
+ }
117
+ return p;
118
+ }
@@ -0,0 +1,32 @@
1
+ const NS = 'http://www.w3.org/2000/svg';
2
+
3
+ function svg(tag, attributes = {}, parent) {
4
+ const element = document.createElementNS(NS, tag);
5
+ for (const [name, value] of Object.entries(attributes)) element.setAttribute(name, String(value));
6
+ parent?.append(element);
7
+ return element;
8
+ }
9
+
10
+ // The eyelids are rectangles painted in the head color over the eyes. A skin
11
+ // paints the head with gradients, so a flat lid would show as a patch. Moving
12
+ // the lids into a mask lets them cut the eyes instead, and the skin shows
13
+ // through. With a flat head color this looks exactly like the original.
14
+ export function maskEyelids(instance) {
15
+ const root = instance.shadowRoot;
16
+ const defs = root.querySelector('defs');
17
+ for (const side of ['left', 'right']) {
18
+ const eye = root.getElementById(`${side}Eye`);
19
+ const lids = root.getElementById(`${side}Top`)?.parentElement;
20
+ if (!eye || !lids || lids.parentElement?.tagName === 'mask') continue;
21
+ const mask = svg('mask', {
22
+ id: `skin-${side}-lids`, maskUnits: 'userSpaceOnUse', maskContentUnits: 'userSpaceOnUse',
23
+ x: -180, y: -240, width: 360, height: 480,
24
+ }, defs);
25
+ svg('rect', { x: -180, y: -240, width: 360, height: 480, fill: '#fff' }, mask);
26
+ for (const lid of lids.children) lid.style.fill = '#000';
27
+ mask.append(lids);
28
+ const paint = svg('g', { mask: `url(#skin-${side}-lids)` });
29
+ paint.append(...eye.children);
30
+ eye.append(paint);
31
+ }
32
+ }
@@ -0,0 +1,29 @@
1
+ const variant = (source,label,english,colors,antenna,eyeColor) => ({
2
+ source,label,english,antenna,
3
+ palette:{baseColor:colors[0],bodyColor:colors[1],bodyEndColor:colors[2],
4
+ secondaryColor:colors[3],reflectionColor:colors[3],edgeColor:colors[4],...(eyeColor ? {eyeColor} : {})},
5
+ });
6
+
7
+ export const glazeVariants = {
8
+ jadeglaze:variant('blueglaze','亮釉翡翠绿','JADE GLAZE',
9
+ ['#086953','#40c49b','#12856c','#b0f1d6','#ddfff0'],['#effff6','#50c99f','#126b57']),
10
+ berryglaze:variant('blueglaze','亮釉莓果粉','BERRY GLAZE',
11
+ ['#9e285f','#ec77ac','#c13b7b','#ffc6e4','#fff0f7'],['#fff1f8','#ed8cba','#a53169']),
12
+ amberglaze:variant('blueglaze','亮釉琥珀橙','AMBER GLAZE',
13
+ ['#ae531b','#f4b053','#db762b','#ffe1af','#fff3dc'],['#fff7dc','#f2b85e','#ad5e27']),
14
+ irisglaze:variant('blueglaze','亮釉鸢尾紫','IRIS GLAZE',
15
+ ['#5831a8','#aa83ef','#7846cf','#ddceff','#f4edff'],['#f7efff','#b18bed','#6440ac']),
16
+ mintice:variant('iceglaze','冰透薄荷绿','MINT ICE',
17
+ ['#8bbcae','#d7f0e5','#b3d8c9','#e9fff5','#f5fff9'],['#ffffff','#c4e6d7','#7fae9c']),
18
+ blushice:variant('iceglaze','冰透樱花粉','BLUSH ICE',
19
+ ['#c093ab','#f5dfe9','#e2bed0','#fff0f7','#fff8fc'],['#ffffff','#e8c9d9','#b28b9f']),
20
+ champagneice:variant('iceglaze','冰透香槟金','CHAMPAGNE ICE',
21
+ ['#c2ac81','#f4e9d2','#e0cda8','#fff6df','#fffaf0'],['#ffffff','#e7d8b9','#b4a078']),
22
+ lavenderice:variant('iceglaze','冰透薰衣紫','LAVENDER ICE',
23
+ ['#a89ac9','#e8e1f6','#cec1e8','#f4efff','#fbf8ff'],['#ffffff','#d8ceeb','#9f91bd'],'#304c6e'),
24
+ blackglaze:variant('blueglaze','亮釉曜石黑','OBSIDIAN GLAZE',
25
+ ['#090d14','#39434f','#101923','#94a5ba','#dce5ee'],['#d9e3ed','#4a596a','#101923'],'#ffffff'),
26
+ whiteice:{...variant('iceglaze','冰透霜白','FROST WHITE ICE',
27
+ ['#c0cdd6','#f6fbff','#dce8ef','#effaff','#ffffff'],['#ffffff','#e7f2f7','#abbfc9'],'#405765'),number:119},
28
+ };
29
+