Repository navigation
Expand file tree
/
Copy pathstyles.rs
More file actions
504 lines (437 loc) · 16.6 KB
/
Copy pathstyles.rs
File metadata and controls
504 lines (437 loc) · 16.6 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
// -----------------------------------------------------------------------------
// MIT License
//
// Copyright (c) 2026 Florian Körner
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// -----------------------------------------------------------------------------
// @generated by scripts/build.sh from src/*.json — do not edit by hand.
//! DiceBear avatar style definitions, embedded at compile time.
//!
//! This is a pure-data crate: the same source styles under `src/` that the
//! packages for the other languages ship, with no logic. The core parses and
//! renders these definitions. This crate only ships the bytes.
//!
//! Each style is gated behind a feature of the same name, so a binary only embeds
//! the styles it opts into:
//!
//! ```toml
//! dicebear-styles = { version = "10", features = ["shapes", "bottts"] }
//! ```
//!
//! Use `all` to pull in every style. The crate embeds the unminified `src/`
//! files and parses them at runtime. The minified `dist/` copy exists for the
//! browser and ships only on npm.
//!
//! The MIT license in this file's header covers this file only. The embedded
//! style definitions carry their own licenses, listed in LICENSE.md and in each
//! definition's `meta` block.
#[cfg(feature = "adventurer")]
pub const ADVENTURER: &str = include_str!("src/adventurer.json");
#[cfg(feature = "adventurer-neutral")]
pub const ADVENTURER_NEUTRAL: &str = include_str!("src/adventurer-neutral.json");
#[cfg(feature = "avataaars")]
pub const AVATAAARS: &str = include_str!("src/avataaars.json");
#[cfg(feature = "avataaars-neutral")]
pub const AVATAAARS_NEUTRAL: &str = include_str!("src/avataaars-neutral.json");
#[cfg(feature = "big-ears")]
pub const BIG_EARS: &str = include_str!("src/big-ears.json");
#[cfg(feature = "big-ears-neutral")]
pub const BIG_EARS_NEUTRAL: &str = include_str!("src/big-ears-neutral.json");
#[cfg(feature = "big-smile")]
pub const BIG_SMILE: &str = include_str!("src/big-smile.json");
#[cfg(feature = "blobs")]
pub const BLOBS: &str = include_str!("src/blobs.json");
#[cfg(feature = "bottts")]
pub const BOTTTS: &str = include_str!("src/bottts.json");
#[cfg(feature = "bottts-neutral")]
pub const BOTTTS_NEUTRAL: &str = include_str!("src/bottts-neutral.json");
#[cfg(feature = "cameo")]
pub const CAMEO: &str = include_str!("src/cameo.json");
#[cfg(feature = "cats")]
pub const CATS: &str = include_str!("src/cats.json");
#[cfg(feature = "clay")]
pub const CLAY: &str = include_str!("src/clay.json");
#[cfg(feature = "constellation")]
pub const CONSTELLATION: &str = include_str!("src/constellation.json");
#[cfg(feature = "critters")]
pub const CRITTERS: &str = include_str!("src/critters.json");
#[cfg(feature = "croodles")]
pub const CROODLES: &str = include_str!("src/croodles.json");
#[cfg(feature = "croodles-neutral")]
pub const CROODLES_NEUTRAL: &str = include_str!("src/croodles-neutral.json");
#[cfg(feature = "cutouts")]
pub const CUTOUTS: &str = include_str!("src/cutouts.json");
#[cfg(feature = "disco")]
pub const DISCO: &str = include_str!("src/disco.json");
#[cfg(feature = "dogs")]
pub const DOGS: &str = include_str!("src/dogs.json");
#[cfg(feature = "dylan")]
pub const DYLAN: &str = include_str!("src/dylan.json");
#[cfg(feature = "fun-emoji")]
pub const FUN_EMOJI: &str = include_str!("src/fun-emoji.json");
#[cfg(feature = "gaze")]
pub const GAZE: &str = include_str!("src/gaze.json");
#[cfg(feature = "glass")]
pub const GLASS: &str = include_str!("src/glass.json");
#[cfg(feature = "glyphs")]
pub const GLYPHS: &str = include_str!("src/glyphs.json");
#[cfg(feature = "icons")]
pub const ICONS: &str = include_str!("src/icons.json");
#[cfg(feature = "identicon")]
pub const IDENTICON: &str = include_str!("src/identicon.json");
#[cfg(feature = "initial-face")]
pub const INITIAL_FACE: &str = include_str!("src/initial-face.json");
#[cfg(feature = "initials")]
pub const INITIALS: &str = include_str!("src/initials.json");
#[cfg(feature = "landscape")]
pub const LANDSCAPE: &str = include_str!("src/landscape.json");
#[cfg(feature = "line-face")]
pub const LINE_FACE: &str = include_str!("src/line-face.json");
#[cfg(feature = "loops")]
pub const LOOPS: &str = include_str!("src/loops.json");
#[cfg(feature = "lorelei")]
pub const LORELEI: &str = include_str!("src/lorelei.json");
#[cfg(feature = "lorelei-neutral")]
pub const LORELEI_NEUTRAL: &str = include_str!("src/lorelei-neutral.json");
#[cfg(feature = "marbles")]
pub const MARBLES: &str = include_str!("src/marbles.json");
#[cfg(feature = "micah")]
pub const MICAH: &str = include_str!("src/micah.json");
#[cfg(feature = "miniavs")]
pub const MINIAVS: &str = include_str!("src/miniavs.json");
#[cfg(feature = "moods")]
pub const MOODS: &str = include_str!("src/moods.json");
#[cfg(feature = "notionists")]
pub const NOTIONISTS: &str = include_str!("src/notionists.json");
#[cfg(feature = "notionists-neutral")]
pub const NOTIONISTS_NEUTRAL: &str = include_str!("src/notionists-neutral.json");
#[cfg(feature = "open-peeps")]
pub const OPEN_PEEPS: &str = include_str!("src/open-peeps.json");
#[cfg(feature = "patchwork")]
pub const PATCHWORK: &str = include_str!("src/patchwork.json");
#[cfg(feature = "personas")]
pub const PERSONAS: &str = include_str!("src/personas.json");
#[cfg(feature = "pixel-art")]
pub const PIXEL_ART: &str = include_str!("src/pixel-art.json");
#[cfg(feature = "pixel-art-neutral")]
pub const PIXEL_ART_NEUTRAL: &str = include_str!("src/pixel-art-neutral.json");
#[cfg(feature = "pixelbot")]
pub const PIXELBOT: &str = include_str!("src/pixelbot.json");
#[cfg(feature = "planets")]
pub const PLANETS: &str = include_str!("src/planets.json");
#[cfg(feature = "rings")]
pub const RINGS: &str = include_str!("src/rings.json");
#[cfg(feature = "shadows")]
pub const SHADOWS: &str = include_str!("src/shadows.json");
#[cfg(feature = "shape-grid")]
pub const SHAPE_GRID: &str = include_str!("src/shape-grid.json");
#[cfg(feature = "shapes")]
pub const SHAPES: &str = include_str!("src/shapes.json");
#[cfg(feature = "slice")]
pub const SLICE: &str = include_str!("src/slice.json");
#[cfg(feature = "sprouts")]
pub const SPROUTS: &str = include_str!("src/sprouts.json");
#[cfg(feature = "squircles")]
pub const SQUIRCLES: &str = include_str!("src/squircles.json");
#[cfg(feature = "stack")]
pub const STACK: &str = include_str!("src/stack.json");
#[cfg(feature = "stripes")]
pub const STRIPES: &str = include_str!("src/stripes.json");
#[cfg(feature = "thumbs")]
pub const THUMBS: &str = include_str!("src/thumbs.json");
#[cfg(feature = "toon-head")]
pub const TOON_HEAD: &str = include_str!("src/toon-head.json");
#[cfg(feature = "triangles")]
pub const TRIANGLES: &str = include_str!("src/triangles.json");
#[cfg(feature = "voxel-art")]
pub const VOXEL_ART: &str = include_str!("src/voxel-art.json");
#[cfg(feature = "voxel-bot")]
pub const VOXEL_BOT: &str = include_str!("src/voxel-bot.json");
#[cfg(feature = "waves")]
pub const WAVES: &str = include_str!("src/waves.json");
#[cfg(feature = "weave")]
pub const WEAVE: &str = include_str!("src/weave.json");
/// Returns the raw JSON definition for the named style, or `None` if the style is
/// unknown or its feature is not enabled in this build.
pub fn get(name: &str) -> Option<&'static str> {
match name {
#[cfg(feature = "adventurer")]
"adventurer" => Some(ADVENTURER),
#[cfg(feature = "adventurer-neutral")]
"adventurer-neutral" => Some(ADVENTURER_NEUTRAL),
#[cfg(feature = "avataaars")]
"avataaars" => Some(AVATAAARS),
#[cfg(feature = "avataaars-neutral")]
"avataaars-neutral" => Some(AVATAAARS_NEUTRAL),
#[cfg(feature = "big-ears")]
"big-ears" => Some(BIG_EARS),
#[cfg(feature = "big-ears-neutral")]
"big-ears-neutral" => Some(BIG_EARS_NEUTRAL),
#[cfg(feature = "big-smile")]
"big-smile" => Some(BIG_SMILE),
#[cfg(feature = "blobs")]
"blobs" => Some(BLOBS),
#[cfg(feature = "bottts")]
"bottts" => Some(BOTTTS),
#[cfg(feature = "bottts-neutral")]
"bottts-neutral" => Some(BOTTTS_NEUTRAL),
#[cfg(feature = "cameo")]
"cameo" => Some(CAMEO),
#[cfg(feature = "cats")]
"cats" => Some(CATS),
#[cfg(feature = "clay")]
"clay" => Some(CLAY),
#[cfg(feature = "constellation")]
"constellation" => Some(CONSTELLATION),
#[cfg(feature = "critters")]
"critters" => Some(CRITTERS),
#[cfg(feature = "croodles")]
"croodles" => Some(CROODLES),
#[cfg(feature = "croodles-neutral")]
"croodles-neutral" => Some(CROODLES_NEUTRAL),
#[cfg(feature = "cutouts")]
"cutouts" => Some(CUTOUTS),
#[cfg(feature = "disco")]
"disco" => Some(DISCO),
#[cfg(feature = "dogs")]
"dogs" => Some(DOGS),
#[cfg(feature = "dylan")]
"dylan" => Some(DYLAN),
#[cfg(feature = "fun-emoji")]
"fun-emoji" => Some(FUN_EMOJI),
#[cfg(feature = "gaze")]
"gaze" => Some(GAZE),
#[cfg(feature = "glass")]
"glass" => Some(GLASS),
#[cfg(feature = "glyphs")]
"glyphs" => Some(GLYPHS),
#[cfg(feature = "icons")]
"icons" => Some(ICONS),
#[cfg(feature = "identicon")]
"identicon" => Some(IDENTICON),
#[cfg(feature = "initial-face")]
"initial-face" => Some(INITIAL_FACE),
#[cfg(feature = "initials")]
"initials" => Some(INITIALS),
#[cfg(feature = "landscape")]
"landscape" => Some(LANDSCAPE),
#[cfg(feature = "line-face")]
"line-face" => Some(LINE_FACE),
#[cfg(feature = "loops")]
"loops" => Some(LOOPS),
#[cfg(feature = "lorelei")]
"lorelei" => Some(LORELEI),
#[cfg(feature = "lorelei-neutral")]
"lorelei-neutral" => Some(LORELEI_NEUTRAL),
#[cfg(feature = "marbles")]
"marbles" => Some(MARBLES),
#[cfg(feature = "micah")]
"micah" => Some(MICAH),
#[cfg(feature = "miniavs")]
"miniavs" => Some(MINIAVS),
#[cfg(feature = "moods")]
"moods" => Some(MOODS),
#[cfg(feature = "notionists")]
"notionists" => Some(NOTIONISTS),
#[cfg(feature = "notionists-neutral")]
"notionists-neutral" => Some(NOTIONISTS_NEUTRAL),
#[cfg(feature = "open-peeps")]
"open-peeps" => Some(OPEN_PEEPS),
#[cfg(feature = "patchwork")]
"patchwork" => Some(PATCHWORK),
#[cfg(feature = "personas")]
"personas" => Some(PERSONAS),
#[cfg(feature = "pixel-art")]
"pixel-art" => Some(PIXEL_ART),
#[cfg(feature = "pixel-art-neutral")]
"pixel-art-neutral" => Some(PIXEL_ART_NEUTRAL),
#[cfg(feature = "pixelbot")]
"pixelbot" => Some(PIXELBOT),
#[cfg(feature = "planets")]
"planets" => Some(PLANETS),
#[cfg(feature = "rings")]
"rings" => Some(RINGS),
#[cfg(feature = "shadows")]
"shadows" => Some(SHADOWS),
#[cfg(feature = "shape-grid")]
"shape-grid" => Some(SHAPE_GRID),
#[cfg(feature = "shapes")]
"shapes" => Some(SHAPES),
#[cfg(feature = "slice")]
"slice" => Some(SLICE),
#[cfg(feature = "sprouts")]
"sprouts" => Some(SPROUTS),
#[cfg(feature = "squircles")]
"squircles" => Some(SQUIRCLES),
#[cfg(feature = "stack")]
"stack" => Some(STACK),
#[cfg(feature = "stripes")]
"stripes" => Some(STRIPES),
#[cfg(feature = "thumbs")]
"thumbs" => Some(THUMBS),
#[cfg(feature = "toon-head")]
"toon-head" => Some(TOON_HEAD),
#[cfg(feature = "triangles")]
"triangles" => Some(TRIANGLES),
#[cfg(feature = "voxel-art")]
"voxel-art" => Some(VOXEL_ART),
#[cfg(feature = "voxel-bot")]
"voxel-bot" => Some(VOXEL_BOT),
#[cfg(feature = "waves")]
"waves" => Some(WAVES),
#[cfg(feature = "weave")]
"weave" => Some(WEAVE),
_ => None,
}
}
/// Names of every style available in this build (those whose feature is enabled).
///
/// Companion to `get`: `all()` lists the names, `get(name)` fetches one.
pub fn all() -> Vec<&'static str> {
#[allow(unused_mut)]
let mut v = Vec::new();
#[cfg(feature = "adventurer")]
v.push("adventurer");
#[cfg(feature = "adventurer-neutral")]
v.push("adventurer-neutral");
#[cfg(feature = "avataaars")]
v.push("avataaars");
#[cfg(feature = "avataaars-neutral")]
v.push("avataaars-neutral");
#[cfg(feature = "big-ears")]
v.push("big-ears");
#[cfg(feature = "big-ears-neutral")]
v.push("big-ears-neutral");
#[cfg(feature = "big-smile")]
v.push("big-smile");
#[cfg(feature = "blobs")]
v.push("blobs");
#[cfg(feature = "bottts")]
v.push("bottts");
#[cfg(feature = "bottts-neutral")]
v.push("bottts-neutral");
#[cfg(feature = "cameo")]
v.push("cameo");
#[cfg(feature = "cats")]
v.push("cats");
#[cfg(feature = "clay")]
v.push("clay");
#[cfg(feature = "constellation")]
v.push("constellation");
#[cfg(feature = "critters")]
v.push("critters");
#[cfg(feature = "croodles")]
v.push("croodles");
#[cfg(feature = "croodles-neutral")]
v.push("croodles-neutral");
#[cfg(feature = "cutouts")]
v.push("cutouts");
#[cfg(feature = "disco")]
v.push("disco");
#[cfg(feature = "dogs")]
v.push("dogs");
#[cfg(feature = "dylan")]
v.push("dylan");
#[cfg(feature = "fun-emoji")]
v.push("fun-emoji");
#[cfg(feature = "gaze")]
v.push("gaze");
#[cfg(feature = "glass")]
v.push("glass");
#[cfg(feature = "glyphs")]
v.push("glyphs");
#[cfg(feature = "icons")]
v.push("icons");
#[cfg(feature = "identicon")]
v.push("identicon");
#[cfg(feature = "initial-face")]
v.push("initial-face");
#[cfg(feature = "initials")]
v.push("initials");
#[cfg(feature = "landscape")]
v.push("landscape");
#[cfg(feature = "line-face")]
v.push("line-face");
#[cfg(feature = "loops")]
v.push("loops");
#[cfg(feature = "lorelei")]
v.push("lorelei");
#[cfg(feature = "lorelei-neutral")]
v.push("lorelei-neutral");
#[cfg(feature = "marbles")]
v.push("marbles");
#[cfg(feature = "micah")]
v.push("micah");
#[cfg(feature = "miniavs")]
v.push("miniavs");
#[cfg(feature = "moods")]
v.push("moods");
#[cfg(feature = "notionists")]
v.push("notionists");
#[cfg(feature = "notionists-neutral")]
v.push("notionists-neutral");
#[cfg(feature = "open-peeps")]
v.push("open-peeps");
#[cfg(feature = "patchwork")]
v.push("patchwork");
#[cfg(feature = "personas")]
v.push("personas");
#[cfg(feature = "pixel-art")]
v.push("pixel-art");
#[cfg(feature = "pixel-art-neutral")]
v.push("pixel-art-neutral");
#[cfg(feature = "pixelbot")]
v.push("pixelbot");
#[cfg(feature = "planets")]
v.push("planets");
#[cfg(feature = "rings")]
v.push("rings");
#[cfg(feature = "shadows")]
v.push("shadows");
#[cfg(feature = "shape-grid")]
v.push("shape-grid");
#[cfg(feature = "shapes")]
v.push("shapes");
#[cfg(feature = "slice")]
v.push("slice");
#[cfg(feature = "sprouts")]
v.push("sprouts");
#[cfg(feature = "squircles")]
v.push("squircles");
#[cfg(feature = "stack")]
v.push("stack");
#[cfg(feature = "stripes")]
v.push("stripes");
#[cfg(feature = "thumbs")]
v.push("thumbs");
#[cfg(feature = "toon-head")]
v.push("toon-head");
#[cfg(feature = "triangles")]
v.push("triangles");
#[cfg(feature = "voxel-art")]
v.push("voxel-art");
#[cfg(feature = "voxel-bot")]
v.push("voxel-bot");
#[cfg(feature = "waves")]
v.push("waves");
#[cfg(feature = "weave")]
v.push("weave");
v
}