opencaptions 0.0.0-stage → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +32 -2
- package/dist/captions.js +267 -0
- package/dist/cli.js +121 -0
- package/dist/client.js +56 -0
- package/dist/engine.js +44 -0
- package/dist/generated/api.js +5 -0
- package/dist/generated/presets.json +687 -0
- package/dist/generated/schemas.json +438 -0
- package/dist/looks.js +57 -0
- package/dist/mcp.js +228 -0
- package/dist/version.js +3 -0
- package/engine/opencaptions_engine.wasm +0 -0
- package/package.json +48 -4
- package/server.json +36 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
{
|
|
2
|
+
"style": {
|
|
3
|
+
"properties": {
|
|
4
|
+
"font": {
|
|
5
|
+
"type": "string",
|
|
6
|
+
"title": "Font",
|
|
7
|
+
"description": "Font family: a bundled one, or any Google Fonts family",
|
|
8
|
+
"default": "Poppins"
|
|
9
|
+
},
|
|
10
|
+
"font_size": {
|
|
11
|
+
"type": "integer",
|
|
12
|
+
"maximum": 300.0,
|
|
13
|
+
"minimum": 12.0,
|
|
14
|
+
"title": "Font Size",
|
|
15
|
+
"description": "Letter size in pixels on a 1920-pixel-high frame; scales with the video's height",
|
|
16
|
+
"default": 64
|
|
17
|
+
},
|
|
18
|
+
"text_color": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"pattern": "^#[0-9A-Fa-f]{6}$",
|
|
21
|
+
"title": "Text Color",
|
|
22
|
+
"description": "Colour of the letters",
|
|
23
|
+
"default": "#FFFFFF"
|
|
24
|
+
},
|
|
25
|
+
"highlight_colors": {
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"pattern": "^#[0-9A-Fa-f]{6}$"
|
|
29
|
+
},
|
|
30
|
+
"type": "array",
|
|
31
|
+
"maxItems": 4,
|
|
32
|
+
"minItems": 1,
|
|
33
|
+
"title": "Highlight Colors",
|
|
34
|
+
"description": "What the animation paints in; the first is the primary. A look that marks each word takes them in turn, a single shape (the sliding box, the bar) is the primary, and a sweep runs through all",
|
|
35
|
+
"default": [
|
|
36
|
+
"#7C3AED"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"background": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"enum": [
|
|
42
|
+
"none",
|
|
43
|
+
"solid",
|
|
44
|
+
"pill",
|
|
45
|
+
"square"
|
|
46
|
+
],
|
|
47
|
+
"title": "Background",
|
|
48
|
+
"description": "A shape behind each line",
|
|
49
|
+
"default": "none"
|
|
50
|
+
},
|
|
51
|
+
"background_color": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"pattern": "^#[0-9A-Fa-f]{6}$",
|
|
54
|
+
"title": "Background Color",
|
|
55
|
+
"description": "Colour of the background shape",
|
|
56
|
+
"default": "#000000"
|
|
57
|
+
},
|
|
58
|
+
"background_opacity": {
|
|
59
|
+
"type": "number",
|
|
60
|
+
"maximum": 1.0,
|
|
61
|
+
"minimum": 0.0,
|
|
62
|
+
"title": "Background Opacity",
|
|
63
|
+
"description": "Opacity of the background shape",
|
|
64
|
+
"default": 0.0
|
|
65
|
+
},
|
|
66
|
+
"position_x": {
|
|
67
|
+
"type": "number",
|
|
68
|
+
"maximum": 1.0,
|
|
69
|
+
"minimum": 0.0,
|
|
70
|
+
"title": "Position X",
|
|
71
|
+
"description": "Where the caption block sits across the frame, 0 left to 1 right; what it anchors depends on align",
|
|
72
|
+
"default": 0.5
|
|
73
|
+
},
|
|
74
|
+
"position_y": {
|
|
75
|
+
"type": "number",
|
|
76
|
+
"maximum": 1.0,
|
|
77
|
+
"minimum": 0.0,
|
|
78
|
+
"title": "Position Y",
|
|
79
|
+
"description": "The caption block's centre down the frame, 0 top to 1 bottom",
|
|
80
|
+
"default": 0.84
|
|
81
|
+
},
|
|
82
|
+
"animation": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"enum": [
|
|
85
|
+
"word_highlight",
|
|
86
|
+
"highlight_box",
|
|
87
|
+
"word_pop",
|
|
88
|
+
"word_fade",
|
|
89
|
+
"word_sweep",
|
|
90
|
+
"word_underline",
|
|
91
|
+
"typewriter",
|
|
92
|
+
"none",
|
|
93
|
+
"word_bounce",
|
|
94
|
+
"lyric_focus",
|
|
95
|
+
"highlight_slide",
|
|
96
|
+
"line_bar",
|
|
97
|
+
"stickers",
|
|
98
|
+
"word_press",
|
|
99
|
+
"letter_rise",
|
|
100
|
+
"word_slam",
|
|
101
|
+
"drift",
|
|
102
|
+
"blur_in"
|
|
103
|
+
],
|
|
104
|
+
"title": "Animation",
|
|
105
|
+
"description": "How words move as they are said. word_highlight: the word takes the highlight colour. highlight_box: a box springs in behind it. word_pop: it grows for a moment. word_fade: it brightens, then dims. word_sweep: the colour fills it left to right. word_underline: an underline is drawn under it. typewriter: typed letter by letter. none: nothing moves. word_bounce: it jumps and leans. lyric_focus: the line is dim and the word comes into focus. highlight_slide: one box slides from word to word. line_bar: a bar under the line fills. stickers: each word on a tilted label. word_press: the word lifts off an extrusion. letter_rise: letters rise into place. word_slam: words slam in. drift: words fade in from a blur and the line floats. blur_in: words come out of a blur",
|
|
106
|
+
"default": "highlight_slide"
|
|
107
|
+
},
|
|
108
|
+
"words_per_line": {
|
|
109
|
+
"type": "integer",
|
|
110
|
+
"maximum": 10.0,
|
|
111
|
+
"minimum": 1.0,
|
|
112
|
+
"title": "Words Per Line",
|
|
113
|
+
"description": "Words shown at once",
|
|
114
|
+
"default": 3
|
|
115
|
+
},
|
|
116
|
+
"word_spacing": {
|
|
117
|
+
"type": "number",
|
|
118
|
+
"maximum": 1.0,
|
|
119
|
+
"minimum": 0.0,
|
|
120
|
+
"title": "Word Spacing",
|
|
121
|
+
"description": "Extra gap between words, in font sizes",
|
|
122
|
+
"default": 0.0
|
|
123
|
+
},
|
|
124
|
+
"stroke_width": {
|
|
125
|
+
"type": "number",
|
|
126
|
+
"maximum": 10.0,
|
|
127
|
+
"minimum": 0.0,
|
|
128
|
+
"title": "Stroke Width",
|
|
129
|
+
"description": "Outline around the letters (0 for none)",
|
|
130
|
+
"default": 0.0
|
|
131
|
+
},
|
|
132
|
+
"stroke_color": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"pattern": "^#[0-9A-Fa-f]{6}$",
|
|
135
|
+
"title": "Stroke Color",
|
|
136
|
+
"description": "Colour of the outline",
|
|
137
|
+
"default": "#000000"
|
|
138
|
+
},
|
|
139
|
+
"shadow_blur": {
|
|
140
|
+
"type": "number",
|
|
141
|
+
"maximum": 20.0,
|
|
142
|
+
"minimum": 0.0,
|
|
143
|
+
"title": "Shadow Blur",
|
|
144
|
+
"description": "Softness of the shadow",
|
|
145
|
+
"default": 10.0
|
|
146
|
+
},
|
|
147
|
+
"shadow_color": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"pattern": "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$",
|
|
150
|
+
"title": "Shadow Color",
|
|
151
|
+
"description": "Colour of the shadow, with an optional alpha channel",
|
|
152
|
+
"default": "#000000A0"
|
|
153
|
+
},
|
|
154
|
+
"shadow_offset_x": {
|
|
155
|
+
"type": "number",
|
|
156
|
+
"maximum": 40.0,
|
|
157
|
+
"minimum": -40.0,
|
|
158
|
+
"title": "Shadow Offset X",
|
|
159
|
+
"description": "Where the shadow falls across, in the units of its blur. With no blur it is solid and drawn as an extrusion: the outline carried on out to the offset",
|
|
160
|
+
"default": 0.0
|
|
161
|
+
},
|
|
162
|
+
"shadow_offset_y": {
|
|
163
|
+
"type": "number",
|
|
164
|
+
"maximum": 40.0,
|
|
165
|
+
"minimum": -40.0,
|
|
166
|
+
"title": "Shadow Offset Y",
|
|
167
|
+
"description": "Where the shadow falls down, as shadow_offset_x",
|
|
168
|
+
"default": 0.0
|
|
169
|
+
},
|
|
170
|
+
"glow_blur": {
|
|
171
|
+
"type": "number",
|
|
172
|
+
"maximum": 40.0,
|
|
173
|
+
"minimum": 0.0,
|
|
174
|
+
"title": "Glow Blur",
|
|
175
|
+
"description": "A halo of glow_color around the letters (0 for none): the neon look",
|
|
176
|
+
"default": 0.0
|
|
177
|
+
},
|
|
178
|
+
"glow_color": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"pattern": "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$",
|
|
181
|
+
"title": "Glow Color",
|
|
182
|
+
"description": "Colour of the glow",
|
|
183
|
+
"default": "#FFFFFF"
|
|
184
|
+
},
|
|
185
|
+
"text_case": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"enum": [
|
|
188
|
+
"none",
|
|
189
|
+
"upper"
|
|
190
|
+
],
|
|
191
|
+
"title": "Text Case",
|
|
192
|
+
"description": "'upper' sets every word in capitals",
|
|
193
|
+
"default": "none"
|
|
194
|
+
},
|
|
195
|
+
"italic": {
|
|
196
|
+
"type": "boolean",
|
|
197
|
+
"title": "Italic",
|
|
198
|
+
"description": "Letters leaned to the right",
|
|
199
|
+
"default": false
|
|
200
|
+
},
|
|
201
|
+
"fill_colors": {
|
|
202
|
+
"items": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"pattern": "^#[0-9A-Fa-f]{6}$"
|
|
205
|
+
},
|
|
206
|
+
"type": "array",
|
|
207
|
+
"maxItems": 4,
|
|
208
|
+
"title": "Fill Colors",
|
|
209
|
+
"description": "A vertical gradient over each word's letters, top to baseline; empty is text_color",
|
|
210
|
+
"default": []
|
|
211
|
+
},
|
|
212
|
+
"extrude_shade": {
|
|
213
|
+
"type": "number",
|
|
214
|
+
"maximum": 1.0,
|
|
215
|
+
"minimum": 0.0,
|
|
216
|
+
"title": "Extrude Shade",
|
|
217
|
+
"description": "How much a solid shadow (an extrusion) darkens from the front to the back",
|
|
218
|
+
"default": 0.0
|
|
219
|
+
},
|
|
220
|
+
"extrude_back": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"pattern": "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$",
|
|
223
|
+
"title": "Extrude Back",
|
|
224
|
+
"description": "The colour the back of an extrusion fades to from shadow_color; transparent for none",
|
|
225
|
+
"default": "#00000000"
|
|
226
|
+
},
|
|
227
|
+
"align": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"enum": [
|
|
230
|
+
"center",
|
|
231
|
+
"left",
|
|
232
|
+
"right",
|
|
233
|
+
"justify"
|
|
234
|
+
],
|
|
235
|
+
"title": "Align",
|
|
236
|
+
"description": "How the rows sit in the block, and what position_x anchors: the block's centre, or for left and right its edge. justify is a poster: short rows, each scaled to the widest one's width",
|
|
237
|
+
"default": "center"
|
|
238
|
+
},
|
|
239
|
+
"letter_spacing": {
|
|
240
|
+
"type": "number",
|
|
241
|
+
"maximum": 1.0,
|
|
242
|
+
"minimum": -0.2,
|
|
243
|
+
"title": "Letter Spacing",
|
|
244
|
+
"description": "Extra space after each letter, in font sizes (negative tightens)",
|
|
245
|
+
"default": 0.0
|
|
246
|
+
},
|
|
247
|
+
"stretch": {
|
|
248
|
+
"type": "number",
|
|
249
|
+
"maximum": 2.0,
|
|
250
|
+
"minimum": 0.5,
|
|
251
|
+
"title": "Stretch",
|
|
252
|
+
"description": "How much wider (or narrower, below 1) the letters are drawn than the face",
|
|
253
|
+
"default": 1.0
|
|
254
|
+
},
|
|
255
|
+
"variants": {
|
|
256
|
+
"items": {
|
|
257
|
+
"properties": {
|
|
258
|
+
"font": {
|
|
259
|
+
"anyOf": [
|
|
260
|
+
{
|
|
261
|
+
"type": "string"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"type": "null"
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"title": "Font",
|
|
268
|
+
"description": "Font family for the word"
|
|
269
|
+
},
|
|
270
|
+
"scale": {
|
|
271
|
+
"anyOf": [
|
|
272
|
+
{
|
|
273
|
+
"type": "number",
|
|
274
|
+
"maximum": 3.0,
|
|
275
|
+
"minimum": 0.3
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"type": "null"
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
"title": "Scale",
|
|
282
|
+
"description": "A multiple of the style's font size"
|
|
283
|
+
},
|
|
284
|
+
"italic": {
|
|
285
|
+
"anyOf": [
|
|
286
|
+
{
|
|
287
|
+
"type": "boolean"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"type": "null"
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
"title": "Italic",
|
|
294
|
+
"description": "Letters leaned to the right"
|
|
295
|
+
},
|
|
296
|
+
"text_case": {
|
|
297
|
+
"anyOf": [
|
|
298
|
+
{
|
|
299
|
+
"type": "string",
|
|
300
|
+
"enum": [
|
|
301
|
+
"none",
|
|
302
|
+
"upper"
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"type": "null"
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"title": "Text Case",
|
|
310
|
+
"description": "'upper' sets the word in capitals"
|
|
311
|
+
},
|
|
312
|
+
"text_color": {
|
|
313
|
+
"anyOf": [
|
|
314
|
+
{
|
|
315
|
+
"type": "string",
|
|
316
|
+
"pattern": "^#[0-9A-Fa-f]{6}$"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"type": "null"
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"title": "Text Color",
|
|
323
|
+
"description": "Colour of the letters"
|
|
324
|
+
},
|
|
325
|
+
"letter_spacing": {
|
|
326
|
+
"anyOf": [
|
|
327
|
+
{
|
|
328
|
+
"type": "number",
|
|
329
|
+
"maximum": 1.0,
|
|
330
|
+
"minimum": -0.2
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"type": "null"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
"title": "Letter Spacing",
|
|
337
|
+
"description": "Extra space after each letter, in font sizes"
|
|
338
|
+
},
|
|
339
|
+
"stretch": {
|
|
340
|
+
"anyOf": [
|
|
341
|
+
{
|
|
342
|
+
"type": "number",
|
|
343
|
+
"maximum": 2.0,
|
|
344
|
+
"minimum": 0.5
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"type": "null"
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
"title": "Stretch",
|
|
351
|
+
"description": "Letters drawn wider (above 1) or narrower"
|
|
352
|
+
},
|
|
353
|
+
"accent": {
|
|
354
|
+
"anyOf": [
|
|
355
|
+
{
|
|
356
|
+
"type": "boolean"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"type": "null"
|
|
360
|
+
}
|
|
361
|
+
],
|
|
362
|
+
"title": "Accent",
|
|
363
|
+
"description": "Set in the style's first highlight colour, so the accent follows it"
|
|
364
|
+
},
|
|
365
|
+
"box_color": {
|
|
366
|
+
"anyOf": [
|
|
367
|
+
{
|
|
368
|
+
"type": "string",
|
|
369
|
+
"pattern": "^#[0-9A-Fa-f]{6}$"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"type": "null"
|
|
373
|
+
}
|
|
374
|
+
],
|
|
375
|
+
"title": "Box Color",
|
|
376
|
+
"description": "A square box of this colour behind the word: a label"
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"type": "object",
|
|
380
|
+
"title": "WordVariant",
|
|
381
|
+
"description": "How one word differs from the style's look; what is left out is the style's own."
|
|
382
|
+
},
|
|
383
|
+
"type": "array",
|
|
384
|
+
"maxItems": 6,
|
|
385
|
+
"title": "Variants",
|
|
386
|
+
"description": "Looks a word can be given instead of the style's own (a word's variant is an index into this)",
|
|
387
|
+
"default": []
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"type": "object",
|
|
391
|
+
"title": "StyleConfig",
|
|
392
|
+
"description": "Caption styling parameters."
|
|
393
|
+
},
|
|
394
|
+
"save": {
|
|
395
|
+
"properties": {
|
|
396
|
+
"resolution": {
|
|
397
|
+
"type": "string",
|
|
398
|
+
"enum": [
|
|
399
|
+
"original",
|
|
400
|
+
"2160",
|
|
401
|
+
"1080",
|
|
402
|
+
"720"
|
|
403
|
+
],
|
|
404
|
+
"title": "Resolution",
|
|
405
|
+
"description": "The short side in pixels, or the source's size",
|
|
406
|
+
"default": "original"
|
|
407
|
+
},
|
|
408
|
+
"frame_rate": {
|
|
409
|
+
"type": "string",
|
|
410
|
+
"enum": [
|
|
411
|
+
"original",
|
|
412
|
+
"30",
|
|
413
|
+
"60"
|
|
414
|
+
],
|
|
415
|
+
"title": "Frame Rate",
|
|
416
|
+
"description": "Frames per second, or the source's rate",
|
|
417
|
+
"default": "original"
|
|
418
|
+
},
|
|
419
|
+
"green_screen": {
|
|
420
|
+
"type": "boolean",
|
|
421
|
+
"title": "Green Screen",
|
|
422
|
+
"description": "Captions only, over solid green to key out, with no sound",
|
|
423
|
+
"default": false
|
|
424
|
+
},
|
|
425
|
+
"format": {
|
|
426
|
+
"type": "string",
|
|
427
|
+
"title": "Format",
|
|
428
|
+
"description": "Format id from the format registry (mp4, mp4-hevc, webm, mov)"
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
"type": "object",
|
|
432
|
+
"required": [
|
|
433
|
+
"format"
|
|
434
|
+
],
|
|
435
|
+
"title": "RenderRequest",
|
|
436
|
+
"description": "POST /projects/{id}/download body: request a render in a specific format."
|
|
437
|
+
}
|
|
438
|
+
}
|
package/dist/looks.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { OpenCaptionsError } from "./client.js";
|
|
2
|
+
import presets from "./generated/presets.json" with { type: "json" };
|
|
3
|
+
import schemas from "./generated/schemas.json" with { type: "json" };
|
|
4
|
+
export const LOOKS = presets;
|
|
5
|
+
/** A look by its name or id, in any case: "Bold", "bold" and "builtin:bold" are the same. */
|
|
6
|
+
export function findLook(name) {
|
|
7
|
+
const wanted = name.trim().toLowerCase();
|
|
8
|
+
const look = LOOKS.find((l) => l.name.toLowerCase() === wanted || l.id === wanted || l.id === `builtin:${wanted}`);
|
|
9
|
+
if (!look) {
|
|
10
|
+
throw new OpenCaptionsError(`There is no look called "${name}". The looks: ${LOOKS.map((l) => l.name).join(", ")}.`);
|
|
11
|
+
}
|
|
12
|
+
return look;
|
|
13
|
+
}
|
|
14
|
+
/** One line on a look: its name, then what makes it what it is. */
|
|
15
|
+
export function describeLook(look) {
|
|
16
|
+
const c = look.config;
|
|
17
|
+
const parts = [c.animation, c.font, ...(c.text_case === "upper" ? ["capitals"] : [])];
|
|
18
|
+
if (c.background && c.background !== "none")
|
|
19
|
+
parts.push(`${c.background} background`);
|
|
20
|
+
parts.push(`highlight ${(c.highlight_colors ?? []).join(" ")}`);
|
|
21
|
+
if ((c.variants ?? []).length > 0)
|
|
22
|
+
parts.push(`${c.variants?.length} word looks dealt at random`);
|
|
23
|
+
return `${look.name}: ${parts.join(", ")}`;
|
|
24
|
+
}
|
|
25
|
+
/** The style's JSON schema, every setting optional: what a tool takes as changes to a look. */
|
|
26
|
+
export const STYLE_SCHEMA = (() => {
|
|
27
|
+
const { required: _required, ...schema } = schemas.style;
|
|
28
|
+
return schema;
|
|
29
|
+
})();
|
|
30
|
+
/** The save options' JSON schema (format, size, frame rate, captions only). */
|
|
31
|
+
export const SAVE_SCHEMA = schemas.save;
|
|
32
|
+
/** Every style setting with its type, range and meaning, one per line. */
|
|
33
|
+
export function describeStyle() {
|
|
34
|
+
const properties = schemas.style.properties;
|
|
35
|
+
return Object.entries(properties)
|
|
36
|
+
.map(([name, p]) => `${name} (${kind(p)}, default ${JSON.stringify(p.default)}): ${p.description}`)
|
|
37
|
+
.join("\n");
|
|
38
|
+
}
|
|
39
|
+
function kind(p) {
|
|
40
|
+
if (p.enum)
|
|
41
|
+
return `one of ${p.enum.join(", ")}`;
|
|
42
|
+
if (p.type === "array") {
|
|
43
|
+
if (p.items?.pattern)
|
|
44
|
+
return `up to ${p.maxItems} colours #RRGGBB`;
|
|
45
|
+
return `up to ${p.maxItems} word looks`;
|
|
46
|
+
}
|
|
47
|
+
if (p.pattern)
|
|
48
|
+
return p.pattern.includes("{2}") ? "colour #RRGGBB or #RRGGBBAA" : "colour #RRGGBB";
|
|
49
|
+
if (p.minimum !== undefined)
|
|
50
|
+
return `${p.type} ${p.minimum} to ${p.maximum}`;
|
|
51
|
+
return p.type ?? "value";
|
|
52
|
+
}
|
|
53
|
+
/** A look with changes over it; settings left out are the look's. */
|
|
54
|
+
export function styleFor(look, changes = {}) {
|
|
55
|
+
const base = findLook(look ?? LOOKS[0]?.name ?? "").config;
|
|
56
|
+
return { ...base, ...changes };
|
|
57
|
+
}
|