@dicebear/glass 9.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 ADDED
@@ -0,0 +1,34 @@
1
+ Licenses
2
+ --------
3
+
4
+ # Design
5
+ Applies to all design files in this package.
6
+
7
+ Source: Glass (https://www.dicebear.com)
8
+ Designer: Florian Körner (https://www.dicebear.com)
9
+ License: CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/)
10
+
11
+ # Code
12
+ Applies to all non-design files in this package.
13
+
14
+ MIT License
15
+
16
+ Copyright (c) 2024 Florian Körner
17
+
18
+ Permission is hereby granted, free of charge, to any person obtaining a copy
19
+ of this software and associated documentation files (the "Software"), to deal
20
+ in the Software without restriction, including without limitation the rights
21
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22
+ copies of the Software, and to permit persons to whom the Software is
23
+ furnished to do so, subject to the following conditions:
24
+
25
+ The above copyright notice and this permission notice shall be included in all
26
+ copies or substantial portions of the Software.
27
+
28
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ <h1 align="center"><img src="https://dicebear.com/logo-readme.svg" width="96" /> <br />DiceBear Glass</h1>
2
+ <p align="center">
3
+ <strong>Avatar Style for <a href="https://dicebear.com/">DiceBear</a></strong><br />
4
+ <a href="https://www.dicebear.com">Glass</a> by <a href="https://www.dicebear.com">Florian Körner</a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ <img src="https://api.dicebear.com/6.x/glass/svg?seed=Mimi" width="64" />
9
+ <img src="https://api.dicebear.com/6.x/glass/svg?seed=Sasha" width="64" />
10
+ <img src="https://api.dicebear.com/6.x/glass/svg?seed=Lilly" width="64" />
11
+ <img src="https://api.dicebear.com/6.x/glass/svg?seed=Tigger" width="64" />
12
+ <img src="https://api.dicebear.com/6.x/glass/svg?seed=Bella" width="64" />
13
+ <img src="https://api.dicebear.com/6.x/glass/svg?seed=Zoe" width="64" />
14
+ <img src="https://api.dicebear.com/6.x/glass/svg?seed=Kitty" width="64" />
15
+ </p>
16
+
17
+ <p align="center">
18
+ The avatar style is based on <a href="https://www.dicebear.com">Glass</a> by
19
+ <a href="https://www.dicebear.com">Florian Körner</a>, licensed under
20
+ <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0 1.0</a>. / Remix of the original.
21
+ </p>
22
+ <p align="center">
23
+ See <a href="https://dicebear.com/licenses">license overview</a> for more information.
24
+ </p>
25
+
26
+ <p align="center">
27
+ <a href="https://dicebear.com/styles/glass">
28
+ Read Documentation
29
+ </a>
30
+ </p>
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ export { shape2 } from './shape2.js';
8
+ export { shape1 } from './shape1.js';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ export { shape2 } from './shape2.js';
8
+ export { shape1 } from './shape1.js';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const shape1: ComponentGroup;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ export const shape1 = {
8
+ 'g': (components, colors) => `<path d="M101.6 51.1a20 20 0 0 0-14.7-14.5q-3.9-1-8.5-1.1-10 0-17 4.8A30 30 0 0 0 50.9 54q-3.6 9-3.6 21.6 0 12.8 3.5 21.8 3.4 9 10.3 14a29 29 0 0 0 17.2 4.8q9 0 15-2.6 6-2.7 9-7.5t3-11.4l6.8.7H78.7v-28h64.5v20q0 20-8.4 34.1a56 56 0 0 1-23.2 21.6Q97 150.6 78 150.6q-21.3 0-37.3-9t-25-25.8-9-39.7a87 87 0 0 1 5.4-32 67 67 0 0 1 38-38Q63 1 77.6 1q12.9 0 24 3.7 11.1 3.6 19.7 10.4a50 50 0 0 1 20.2 36z" fill="white"/>`,
9
+ 'r': (components, colors) => `<path d="M17.6 148.6V3h62.8q16.2 0 28.3 6 12 5.8 18.9 16.9a50 50 0 0 1 6.7 26.5q0 15.7-7 26.4A43 43 0 0 1 108 95q-12.5 5.5-29 5.5H41.3V69.9H71q7 0 11.8-1.7a15 15 0 0 0 7.6-5.6 17 17 0 0 0 2.7-10q0-6.3-2.7-10.2a15 15 0 0 0-7.6-5.8q-4.9-2-11.8-2H57v114zm85.2-66.8 36.4 66.8h-43L60.9 81.8z" fill="white"/>`,
10
+ 'a': (components, colors) => `<path d="M42.6 148.6H0L48 3h54l48 145.5h-42.7L75.5 43.2h-1.1zm-8-57.4h80.1v29.5h-80z" fill="white"/>`,
11
+ 'd': (components, colors) => `<path d="M67 148.6H11V3h55.4q22.5 0 38.8 8.7a60 60 0 0 1 25.3 25q9 16.4 9 39 0 22.8-9 39.1a61 61 0 0 1-25 25 81 81 0 0 1-38.5 8.7M50.5 115h15a44 44 0 0 0 18.5-3.4q7.6-3.6 11.6-12t4-23.8q0-15-4-23.7a24 24 0 0 0-12-12 47 47 0 0 0-19.2-3.5H50.5z" fill="white"/>`,
12
+ 'i': (components, colors) => `<path d="M94.8 3.1v145.5H55.3V3z" fill="white"/>`,
13
+ 'e': (components, colors) => `<path d="M22.2 148.6V3H127v32H61.7v25h59.9v31.8h-60v25h65.1v31.9z" fill="white"/>`,
14
+ 'n': (components, colors) => `<path d="M138 3.1v145.5h-33L52.5 72h-1v76.5H12.2V3h33.5l51.7 76.1h1.2v-76z" fill="white"/>`,
15
+ 't': (components, colors) => `<path d="M11.7 35V3h126.5v32H94.4v113.7h-39V34.9z" fill="white"/>`,
16
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const shape2: ComponentGroup;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ export const shape2 = {
8
+ 'g': (components, colors) => `<path d="M101.6 51.2a20 20 0 0 0-14.7-14.5q-3.9-1-8.5-1-10 0-17 4.7A30 30 0 0 0 50.9 54q-3.6 9-3.6 21.6 0 12.8 3.5 21.8 3.4 9 10.3 14a29 29 0 0 0 17.2 4.8q9 0 15-2.6 6-2.7 9-7.5t3-11.4l6.8.7H78.7v-28h64.5v20q0 20-8.4 34.1a56 56 0 0 1-23.2 21.6Q97 150.7 78 150.7q-21.3 0-37.3-9t-25-25.8q-9-16.5-9-39.7a87 87 0 0 1 5.4-32 67 67 0 0 1 38-38q12.9-5 27.6-5 12.9 0 24 3.7 11.1 3.6 19.7 10.4a50 50 0 0 1 20.2 36z" fill="white"/>`,
9
+ 'r': (components, colors) => `<path d="M17.6 148.7V3.2h62.8q16.2 0 28.3 6 12 5.8 18.9 16.9a50 50 0 0 1 6.7 26.6q0 15.6-7 26.3A43 43 0 0 1 108 95.2q-12.5 5.5-29 5.5H41.3V70H71q7 0 11.8-1.7a15 15 0 0 0 7.6-5.6 17 17 0 0 0 2.7-10q0-6.3-2.7-10.2a15 15 0 0 0-7.6-5.8q-4.9-2-11.8-2H57v114zm85.2-66.8 36.4 66.8h-43L60.9 81.9z" fill="white"/>`,
10
+ 'a': (components, colors) => `<path d="M42.6 148.7H0L48 3.2h54l48 145.5h-42.7L75.5 43.3h-1.1zm-8-57.4h80.1v29.5h-80z" fill="white"/>`,
11
+ 'd': (components, colors) => `<path d="M67 148.7H11V3.2h55.4q22.5 0 38.8 8.8a60 60 0 0 1 25.3 25q9 16.2 9 39 0 22.6-9 39a61 61 0 0 1-25 25 81 81 0 0 1-38.5 8.7m-16.5-33.5h15a44 44 0 0 0 18.5-3.5q7.6-3.5 11.6-12t4-23.8q0-15-4-23.7a24 24 0 0 0-12-12 47 47 0 0 0-19.2-3.5H50.5z" fill="white"/>`,
12
+ 'i': (components, colors) => `<path d="M94.8 3.2v145.5H55.3V3.2z" fill="white"/>`,
13
+ 'e': (components, colors) => `<path d="M22.2 148.7V3.2H127V35H61.7v25h59.9v32h-60v25h65.1v31.8z" fill="white"/>`,
14
+ 'n': (components, colors) => `<path d="M138 3.2v145.5h-33L52.5 72.3h-1v76.4H12.2V3.2h33.5l51.7 76.2h1.2V3.2z" fill="white"/>`,
15
+ 't': (components, colors) => `<path d="M11.7 35V3.2h126.5V35H94.4v113.7h-39V35z" fill="white"/>`,
16
+ };
package/lib/index.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ /*!
8
+ * Glass (@dicebear/glass)
9
+ *
10
+ * Code licensed under MIT License.
11
+ * Copyright (c) 2024 Florian Körner
12
+ *
13
+ * Design "Glass" by Florian Körner licensed under CC0 1.0. / Remix of the original.
14
+ * Source: https://www.dicebear.com
15
+ * Homepage: https://www.dicebear.com
16
+ * License: https://creativecommons.org/publicdomain/zero/1.0/
17
+ */
18
+ import type { StyleCreate, StyleMeta } from '@dicebear/core';
19
+ import type { Options } from './types.js';
20
+ export declare const meta: StyleMeta;
21
+ export declare const create: StyleCreate<Options>;
22
+ export { schema } from './schema.js';
23
+ export type { Options } from './types.js';
package/lib/index.js ADDED
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ import { getComponents } from './utils/getComponents.js';
8
+ import { getColors } from './utils/getColors.js';
9
+ export const meta = {
10
+ title: 'Glass',
11
+ creator: 'Florian Körner',
12
+ source: 'https://www.dicebear.com',
13
+ homepage: 'https://www.dicebear.com',
14
+ license: {
15
+ name: 'CC0 1.0',
16
+ url: 'https://creativecommons.org/publicdomain/zero/1.0/',
17
+ },
18
+ };
19
+ export const create = ({ prng, options }) => {
20
+ var _a, _b, _c, _d;
21
+ const components = getComponents({ prng, options });
22
+ const colors = getColors({ prng, options });
23
+ return {
24
+ attributes: {
25
+ viewBox: '0 0 100 100',
26
+ fill: 'none',
27
+ 'shape-rendering': 'auto'
28
+ },
29
+ body: `<g style="mix-blend-mode:screen" opacity="0.6" filter="url(#dicebearGlass-a)"><g transform="translate(-25 -25)">${(_b = (_a = components.shape2) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}</g></g><g style="mix-blend-mode:screen" opacity="0.6" filter="url(#dicebearGlass-b)"><g transform="translate(-25 -25)">${(_d = (_c = components.shape1) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}</g></g><defs><filter id="dicebearGlass-a" x="-57" y="-57" width="214" height="214" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="16" result="effect1_foregroundBlur_18_184"/></filter><filter id="dicebearGlass-b" x="-57" y="-57" width="214" height="214" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="16" result="effect1_foregroundBlur_18_184"/></filter></defs>`,
30
+ extra: () => ({
31
+ ...Object.entries(components).reduce((acc, [key, value]) => {
32
+ acc[key] = value === null || value === void 0 ? void 0 : value.name;
33
+ return acc;
34
+ }, {}),
35
+ ...Object.entries(colors).reduce((acc, [key, value]) => {
36
+ acc[`${key}Color`] = value;
37
+ return acc;
38
+ }, {}),
39
+ }),
40
+ };
41
+ };
42
+ export { schema } from './schema.js';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ import type { StyleSchema } from '@dicebear/core';
8
+ export declare const schema: StyleSchema;
package/lib/schema.js ADDED
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ export const schema = {
8
+ "$schema": "http://json-schema.org/draft-07/schema#",
9
+ "properties": {
10
+ "backgroundColor": {
11
+ "type": "array",
12
+ "items": {
13
+ "type": "string",
14
+ "pattern": "^(transparent|[a-fA-F0-9]{6})$"
15
+ },
16
+ "default": [
17
+ "eb4747",
18
+ "eb6247",
19
+ "eb7e47",
20
+ "eb9947",
21
+ "ebb447",
22
+ "ebd047",
23
+ "ebeb47",
24
+ "d0eb47",
25
+ "b4eb47",
26
+ "99eb47",
27
+ "7eeb47",
28
+ "62eb47",
29
+ "47eb47",
30
+ "47eb62",
31
+ "47eb7e",
32
+ "47eb99",
33
+ "47ebb4",
34
+ "47ebd0",
35
+ "47ebeb",
36
+ "47d0eb",
37
+ "47b4eb",
38
+ "4799eb",
39
+ "477eeb",
40
+ "4762eb",
41
+ "4747eb",
42
+ "6247eb",
43
+ "7e47eb",
44
+ "9947eb",
45
+ "b447eb",
46
+ "d047eb",
47
+ "eb47eb",
48
+ "eb47d0",
49
+ "eb4799",
50
+ "eb477e",
51
+ "eb4762"
52
+ ]
53
+ },
54
+ "shape1": {
55
+ "type": "array",
56
+ "items": {
57
+ "type": "string",
58
+ "enum": [
59
+ "g",
60
+ "r",
61
+ "a",
62
+ "d",
63
+ "i",
64
+ "e",
65
+ "n",
66
+ "t"
67
+ ]
68
+ },
69
+ "default": [
70
+ "g",
71
+ "r",
72
+ "a",
73
+ "d",
74
+ "i",
75
+ "e",
76
+ "n",
77
+ "t"
78
+ ]
79
+ },
80
+ "shape1OffsetX": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "integer",
84
+ "minimum": -80,
85
+ "maximum": 80
86
+ },
87
+ "maxItems": 2,
88
+ "default": [
89
+ -80,
90
+ 80
91
+ ]
92
+ },
93
+ "shape1OffsetY": {
94
+ "type": "array",
95
+ "items": {
96
+ "type": "integer",
97
+ "minimum": -80,
98
+ "maximum": 80
99
+ },
100
+ "maxItems": 2,
101
+ "default": [
102
+ -80,
103
+ 80
104
+ ]
105
+ },
106
+ "shape1Rotation": {
107
+ "type": "array",
108
+ "items": {
109
+ "type": "integer",
110
+ "minimum": -180,
111
+ "maximum": 180
112
+ },
113
+ "maxItems": 2,
114
+ "default": [
115
+ -180,
116
+ 180
117
+ ]
118
+ },
119
+ "shape2": {
120
+ "type": "array",
121
+ "items": {
122
+ "type": "string",
123
+ "enum": [
124
+ "g",
125
+ "r",
126
+ "a",
127
+ "d",
128
+ "i",
129
+ "e",
130
+ "n",
131
+ "t"
132
+ ]
133
+ },
134
+ "default": [
135
+ "g",
136
+ "r",
137
+ "a",
138
+ "d",
139
+ "i",
140
+ "e",
141
+ "n",
142
+ "t"
143
+ ]
144
+ },
145
+ "shape2OffsetX": {
146
+ "type": "array",
147
+ "items": {
148
+ "type": "integer",
149
+ "minimum": -80,
150
+ "maximum": 80
151
+ },
152
+ "maxItems": 2,
153
+ "default": [
154
+ -80,
155
+ 80
156
+ ]
157
+ },
158
+ "shape2OffsetY": {
159
+ "type": "array",
160
+ "items": {
161
+ "type": "integer",
162
+ "minimum": -80,
163
+ "maximum": 80
164
+ },
165
+ "maxItems": 2,
166
+ "default": [
167
+ -80,
168
+ 80
169
+ ]
170
+ },
171
+ "shape2Rotation": {
172
+ "type": "array",
173
+ "items": {
174
+ "type": "integer",
175
+ "minimum": -160,
176
+ "maximum": 160
177
+ },
178
+ "maxItems": 2,
179
+ "default": [
180
+ -160,
181
+ 160
182
+ ]
183
+ }
184
+ }
185
+ };
package/lib/types.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ export interface Options {
8
+ shape2?: ('g' | 'r' | 'a' | 'd' | 'i' | 'e' | 'n' | 't')[];
9
+ shape2Rotation?: number[];
10
+ shape2OffsetX?: number[];
11
+ shape2OffsetY?: number[];
12
+ shape1?: ('g' | 'r' | 'a' | 'd' | 'i' | 'e' | 'n' | 't')[];
13
+ shape1Rotation?: number[];
14
+ shape1OffsetX?: number[];
15
+ shape1OffsetY?: number[];
16
+ backgroundColor?: string[];
17
+ }
18
+ export type ColorPickCollection = Record<string, string>;
19
+ export type ComponentGroup = Record<string, ComponentGroupItem>;
20
+ export type ComponentGroupCollection = Record<string, ComponentGroup>;
21
+ export type ComponentGroupItem = (components: ComponentPickCollection, colors: ColorPickCollection) => string;
22
+ export type ComponentPickCollection = Record<string, ComponentPick>;
23
+ export type ComponentPick = {
24
+ name: string;
25
+ value: ComponentGroupItem;
26
+ rotation: number | undefined;
27
+ offsetX: number | undefined;
28
+ offsetY: number | undefined;
29
+ } | undefined;
package/lib/types.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ export declare function convertColor(color: string): string;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ export function convertColor(color) {
8
+ return 'transparent' === color ? color : `#${color}`;
9
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ import type { Prng } from '@dicebear/core';
8
+ import type { Options, ColorPickCollection } from '../types.js';
9
+ type Props = {
10
+ prng: Prng;
11
+ options: Options;
12
+ };
13
+ export declare function getColors({ prng, options }: Props): ColorPickCollection;
14
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ export function getColors({ prng, options }) {
8
+ return {};
9
+ }
10
+ ;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ import type { Prng } from '@dicebear/core';
8
+ import type { Options, ComponentPickCollection } from '../types.js';
9
+ type Props = {
10
+ prng: Prng;
11
+ options: Options;
12
+ };
13
+ export declare function getComponents({ prng, options }: Props): ComponentPickCollection;
14
+ export {};
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ import { pickComponent } from './pickComponent.js';
8
+ export function getComponents({ prng, options }) {
9
+ var _a, _b, _c, _d, _e, _f;
10
+ const shape2Component = pickComponent({
11
+ prng,
12
+ group: 'shape2',
13
+ values: options.shape2,
14
+ width: 150,
15
+ height: 150,
16
+ rotation: ((_a = options.shape2Rotation) === null || _a === void 0 ? void 0 : _a.length) ? options.shape2Rotation : [0],
17
+ offsetX: ((_b = options.shape2OffsetX) === null || _b === void 0 ? void 0 : _b.length) ? options.shape2OffsetX : [0],
18
+ offsetY: ((_c = options.shape2OffsetY) === null || _c === void 0 ? void 0 : _c.length) ? options.shape2OffsetY : [0],
19
+ });
20
+ const shape1Component = pickComponent({
21
+ prng,
22
+ group: 'shape1',
23
+ values: options.shape1,
24
+ width: 150,
25
+ height: 150,
26
+ rotation: ((_d = options.shape1Rotation) === null || _d === void 0 ? void 0 : _d.length) ? options.shape1Rotation : [0],
27
+ offsetX: ((_e = options.shape1OffsetX) === null || _e === void 0 ? void 0 : _e.length) ? options.shape1OffsetX : [0],
28
+ offsetY: ((_f = options.shape1OffsetY) === null || _f === void 0 ? void 0 : _f.length) ? options.shape1OffsetY : [0],
29
+ });
30
+ return {
31
+ 'shape2': shape2Component,
32
+ 'shape1': shape1Component,
33
+ };
34
+ }
35
+ ;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ import type { Prng } from '@dicebear/core';
8
+ import type { ComponentPick } from '../types.js';
9
+ type Props = {
10
+ prng: Prng;
11
+ group: string;
12
+ values?: string[];
13
+ width: number;
14
+ height: number;
15
+ rotation: number[];
16
+ offsetX: number[];
17
+ offsetY: number[];
18
+ };
19
+ export declare function pickComponent({ prng, group, width, height, values, rotation, offsetX, offsetY }: Props): ComponentPick;
20
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/design/MbbQiNEkuiiLZSbZuPzyVD
6
+ */
7
+ import * as components from '../components/index.js';
8
+ export function pickComponent({ prng, group, width, height, values = [], rotation, offsetX, offsetY }) {
9
+ const componentCollection = components;
10
+ const key = prng.pick(values);
11
+ const pickedRotation = prng.integer(Math.min(...rotation), Math.max(...rotation));
12
+ const pickedOffsetX = prng.integer(Math.min(...offsetX), Math.max(...offsetX));
13
+ const pickedOffsetY = prng.integer(Math.min(...offsetY), Math.max(...offsetY));
14
+ if (key && componentCollection[group][key]) {
15
+ return {
16
+ name: key,
17
+ value(components, colors) {
18
+ var _a, _b, _c;
19
+ let result = componentCollection[group][key](components, colors);
20
+ if (this.rotation || this.offsetX || this.offsetY) {
21
+ result = `<g transform="translate(${((_a = this.offsetX) !== null && _a !== void 0 ? _a : 0)}, ${(_b = this.offsetY) !== null && _b !== void 0 ? _b : 0}) rotate(${(_c = this.rotation) !== null && _c !== void 0 ? _c : 0} ${width / 2} ${height / 2})">${result}</g>`;
22
+ }
23
+ return result;
24
+ },
25
+ rotation: pickedRotation,
26
+ offsetX: pickedOffsetX,
27
+ offsetY: pickedOffsetY,
28
+ };
29
+ }
30
+ else {
31
+ return undefined;
32
+ }
33
+ }
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@dicebear/glass",
3
+ "version": "9.2.0",
4
+ "description": "Avatar style for DiceBear",
5
+ "keywords": [
6
+ "dicebear"
7
+ ],
8
+ "bugs": {
9
+ "url": "https://github.com/dicebear/dicebear/issues"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/dicebear/dicebear.git"
14
+ },
15
+ "license": "MIT",
16
+ "type": "module",
17
+ "main": "./lib/index.js",
18
+ "exports": "./lib/index.js",
19
+ "types": "./lib/index.d.ts",
20
+ "files": [
21
+ "LICENSE",
22
+ "lib",
23
+ "README.md"
24
+ ],
25
+ "scripts": {
26
+ "prebuild": "del-cli lib",
27
+ "build": "tsc",
28
+ "prepublishOnly": "npm run build",
29
+ "test": "uvu tests"
30
+ },
31
+ "devDependencies": {
32
+ "@dicebear/core": "9.2.0",
33
+ "@tsconfig/recommended": "^1.0.2",
34
+ "del-cli": "^5.0.0",
35
+ "typescript": "^5.1.6",
36
+ "uvu": "^0.5.6"
37
+ },
38
+ "peerDependencies": {
39
+ "@dicebear/core": "^9.0.0"
40
+ },
41
+ "engines": {
42
+ "node": ">=18.0.0"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "gitHead": "a4f64b6235f77e30ca962199d806069c188fcaa7"
48
+ }