@dicebear/pixel-art 5.0.0-alpha.21 → 5.0.0-alpha.26

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/lib/types.d.ts CHANGED
@@ -1,25 +1,21 @@
1
1
  export interface Options {
2
- beard?: ('variant04' | 'variant03' | 'variant02' | 'variant01')[];
3
- beardProbability?: number;
4
- eyes?: ('variant13' | 'variant12' | 'variant11' | 'variant10' | 'variant09' | 'variant08' | 'variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[];
5
- eyebrows?: ('variant13' | 'variant12' | 'variant11' | 'variant10' | 'variant09' | 'variant08' | 'variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[];
6
- mouth?: ('surprised03' | 'surprised02' | 'happy09' | 'happy08' | 'happy07' | 'happy06' | 'happy05' | 'happy04' | 'happy03' | 'happy02' | 'happy01' | 'sad08' | 'sad07' | 'sad06' | 'sad05' | 'sad04' | 'sad03' | 'sad02' | 'sad01' | 'surprised01')[];
7
- hair?: ('short11' | 'short10' | 'short09' | 'short08' | 'short07' | 'short06' | 'short05' | 'short04' | 'short03' | 'short02' | 'long15' | 'short01' | 'long14' | 'long13' | 'long12' | 'long11' | 'long10' | 'long09' | 'long08' | 'long07' | 'long06' | 'long05' | 'long04' | 'long03' | 'long02' | 'long01')[];
8
- hairProbability?: number;
9
2
  accessories?: ('variant04' | 'variant03' | 'variant02' | 'variant01')[];
10
3
  accessoriesProbability?: number;
11
- glasses?: ('variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[];
4
+ clothing?: ('variant23' | 'variant22' | 'variant21' | 'variant20' | 'variant19' | 'variant18' | 'variant17' | 'variant16' | 'variant15' | 'variant14' | 'variant13' | 'variant12' | 'variant11' | 'variant10' | 'variant09' | 'variant08' | 'variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[];
5
+ eyes?: ('variant12' | 'variant11' | 'variant10' | 'variant09' | 'variant08' | 'variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[];
6
+ glasses?: ('light07' | 'light06' | 'light05' | 'light04' | 'light03' | 'light02' | 'light01' | 'dark07' | 'dark06' | 'dark05' | 'dark04' | 'dark03' | 'dark02' | 'dark01')[];
12
7
  glassesProbability?: number;
13
- hat?: ('variant01' | 'variant02' | 'variant03' | 'variant04' | 'variant05' | 'variant06' | 'variant07' | 'variant08' | 'variant09' | 'variant10' | 'variant11' | 'variant12')[];
14
- hatProbability?: number;
15
- clothing?: ('variant25' | 'variant24' | 'variant23' | 'variant22' | 'variant21' | 'variant20' | 'variant19' | 'variant18' | 'variant17' | 'variant16' | 'variant15' | 'variant14' | 'variant13' | 'variant12' | 'variant11' | 'variant10' | 'variant09' | 'variant08' | 'variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[];
16
- skinColor?: string[];
17
- hairColor?: string[];
8
+ beard?: ('variant08' | 'variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[];
9
+ beardProbability?: number;
10
+ mouth?: ('sad10' | 'sad09' | 'sad08' | 'sad07' | 'sad06' | 'sad05' | 'sad04' | 'sad03' | 'sad02' | 'sad01' | 'happy13' | 'happy12' | 'happy11' | 'happy10' | 'happy09' | 'happy08' | 'happy07' | 'happy06' | 'happy05' | 'happy04' | 'happy03' | 'happy02' | 'happy01')[];
11
+ hair?: ('short24' | 'short23' | 'short22' | 'short21' | 'short20' | 'short19' | 'short18' | 'short17' | 'short16' | 'short15' | 'short14' | 'short13' | 'short12' | 'short11' | 'short10' | 'short09' | 'short08' | 'short07' | 'short06' | 'short05' | 'short04' | 'short03' | 'short02' | 'short01' | 'long21' | 'long20' | 'long19' | 'long18' | 'long17' | 'long16' | 'long15' | 'long14' | 'long13' | 'long12' | 'long11' | 'long10' | 'long09' | 'long08' | 'long07' | 'long06' | 'long05' | 'long04' | 'long03' | 'long02' | 'long01')[];
18
12
  accessoriesColor?: string[];
19
- mouthColor?: string[];
20
- clothesColor?: string[];
21
- hatColor?: string[];
13
+ clothingColor?: string[];
14
+ eyesColor?: string[];
22
15
  glassesColor?: string[];
16
+ hairColor?: string[];
17
+ mouthColor?: string[];
18
+ skinColor?: string[];
23
19
  }
24
20
  export declare type ColorGroup = Record<string, ColorGroupItem>;
25
21
  export declare type ColorGroupCollection = Record<string, ColorGroup>;
@@ -1,40 +1,40 @@
1
1
  import { pickColor } from './pickColor.js';
2
2
  export function getColors({ prng, options }) {
3
3
  return {
4
- skin: pickColor({
5
- prng,
6
- group: 'skin',
7
- values: options.skinColor,
8
- }),
9
- hair: pickColor({
10
- prng,
11
- group: 'hair',
12
- values: options.hairColor,
13
- }),
14
4
  accessories: pickColor({
15
5
  prng,
16
6
  group: 'accessories',
17
7
  values: options.accessoriesColor,
18
8
  }),
19
- mouth: pickColor({
20
- prng,
21
- group: 'mouth',
22
- values: options.mouthColor,
23
- }),
24
- clothes: pickColor({
9
+ clothing: pickColor({
25
10
  prng,
26
- group: 'clothes',
27
- values: options.clothesColor,
11
+ group: 'clothing',
12
+ values: options.clothingColor,
28
13
  }),
29
- hat: pickColor({
14
+ eyes: pickColor({
30
15
  prng,
31
- group: 'hat',
32
- values: options.hatColor,
16
+ group: 'eyes',
17
+ values: options.eyesColor,
33
18
  }),
34
19
  glasses: pickColor({
35
20
  prng,
36
21
  group: 'glasses',
37
22
  values: options.glassesColor,
38
23
  }),
24
+ hair: pickColor({
25
+ prng,
26
+ group: 'hair',
27
+ values: options.hairColor,
28
+ }),
29
+ mouth: pickColor({
30
+ prng,
31
+ group: 'mouth',
32
+ values: options.mouthColor,
33
+ }),
34
+ skin: pickColor({
35
+ prng,
36
+ group: 'skin',
37
+ values: options.skinColor,
38
+ }),
39
39
  };
40
40
  }
@@ -1,19 +1,29 @@
1
1
  import { pickComponent } from './pickComponent.js';
2
2
  export function getComponents({ prng, options, }) {
3
- const beardComponent = pickComponent({
3
+ const accessoriesComponent = pickComponent({
4
4
  prng,
5
- group: 'beard',
6
- values: options.beard,
5
+ group: 'accessories',
6
+ values: options.accessories,
7
+ });
8
+ const clothingComponent = pickComponent({
9
+ prng,
10
+ group: 'clothing',
11
+ values: options.clothing,
7
12
  });
8
13
  const eyesComponent = pickComponent({
9
14
  prng,
10
15
  group: 'eyes',
11
16
  values: options.eyes,
12
17
  });
13
- const eyebrowsComponent = pickComponent({
18
+ const glassesComponent = pickComponent({
14
19
  prng,
15
- group: 'eyebrows',
16
- values: options.eyebrows,
20
+ group: 'glasses',
21
+ values: options.glasses,
22
+ });
23
+ const beardComponent = pickComponent({
24
+ prng,
25
+ group: 'beard',
26
+ values: options.beard,
17
27
  });
18
28
  const mouthComponent = pickComponent({
19
29
  prng,
@@ -25,39 +35,17 @@ export function getComponents({ prng, options, }) {
25
35
  group: 'hair',
26
36
  values: options.hair,
27
37
  });
28
- const accessoriesComponent = pickComponent({
29
- prng,
30
- group: 'accessories',
31
- values: options.accessories,
32
- });
33
- const glassesComponent = pickComponent({
34
- prng,
35
- group: 'glasses',
36
- values: options.glasses,
37
- });
38
- const hatComponent = pickComponent({
39
- prng,
40
- group: 'hat',
41
- values: options.hat,
42
- });
43
- const clothingComponent = pickComponent({
44
- prng,
45
- group: 'clothing',
46
- values: options.clothing,
47
- });
48
38
  return {
49
- beard: prng.bool(options.beardProbability) ? beardComponent : undefined,
50
- eyes: eyesComponent,
51
- eyebrows: eyebrowsComponent,
52
- mouth: mouthComponent,
53
- hair: prng.bool(options.hairProbability) ? hairComponent : undefined,
54
39
  accessories: prng.bool(options.accessoriesProbability)
55
40
  ? accessoriesComponent
56
41
  : undefined,
42
+ clothing: clothingComponent,
43
+ eyes: eyesComponent,
57
44
  glasses: prng.bool(options.glassesProbability)
58
45
  ? glassesComponent
59
46
  : undefined,
60
- hat: prng.bool(options.hatProbability) ? hatComponent : undefined,
61
- clothing: clothingComponent,
47
+ beard: prng.bool(options.beardProbability) ? beardComponent : undefined,
48
+ mouth: mouthComponent,
49
+ hair: hairComponent,
62
50
  };
63
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicebear/pixel-art",
3
- "version": "5.0.0-alpha.21",
3
+ "version": "5.0.0-alpha.26",
4
4
  "description": "Avatar style for DiceBear",
5
5
  "keywords": [
6
6
  "dicebear"
@@ -28,14 +28,14 @@
28
28
  "test": "uvu tests"
29
29
  },
30
30
  "devDependencies": {
31
- "@dicebear/core": "^5.0.0-alpha.21",
31
+ "@dicebear/core": "^5.0.0-alpha.26",
32
32
  "@tsconfig/recommended": "^1.0.1",
33
33
  "del-cli": "^4.0.1",
34
34
  "typescript": "^4.6.3",
35
35
  "uvu": "^0.5.3"
36
36
  },
37
37
  "peerDependencies": {
38
- "@dicebear/core": "^5.0.0-alpha.16"
38
+ "@dicebear/core": "^5.0.0-alpha.21"
39
39
  },
40
40
  "engines": {
41
41
  "node": "^14.13.1 || >=16.0.0"
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "40b7190a19ba3c6c355178f1ae6c422229634e06"
46
+ "gitHead": "68a91a6c5fa46dd8317fe066803657ac0bf59f68"
47
47
  }
package/lib/colors/hat.js DELETED
@@ -1,9 +0,0 @@
1
- export const hat = {
2
- pink01: 'rgba(204, 97, 146, 1)',
3
- blue01: 'rgba(38, 99, 163, 1)',
4
- green01: 'rgba(61, 138, 107, 1)',
5
- purple01: 'rgba(97, 79, 138, 1)',
6
- red01: 'rgba(166, 33, 22, 1)',
7
- black01: 'rgba(46, 30, 5, 1)',
8
- gray01: 'rgba(152, 151, 137, 1)',
9
- };
@@ -1,2 +0,0 @@
1
- import type { ComponentGroup } from '../types.js';
2
- export declare const eyebrows: ComponentGroup;
@@ -1,15 +0,0 @@
1
- export const eyebrows = {
2
- variant13: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M8 4v1H7v1H5V5h2V4h1Zm4 0h1v1h2v1h-2V5h-1V4Z" fill="${colors.hair.value}"/><path d="M8 4v1H7v1H5V5h2V4h1Zm4 0h1v1h2v1h-2V5h-1V4Z" fill="#000" fill-opacity=".1"/></g>`,
3
- variant12: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 5h3v2H8V6H6V5Zm5 0h3v1h-2v1h-1V5Z" fill="${colors.hair.value}"/><path d="M6 5h3v2H8V6H6V5Zm5 0h3v1h-2v1h-1V5Z" fill="#000" fill-opacity=".1"/></g>`,
4
- variant11: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 5h3v1h1v1H8V6H5V5Zm10 0h-3v1h-1v1h1V6h3V5Z" fill="${colors.hair.value}"/><path d="M5 5h3v1h1v1H8V6H5V5Zm10 0h-3v1h-1v1h1V6h3V5Z" fill="#000" fill-opacity=".1"/></g>`,
5
- variant10: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 5H4v2h1V6h1V5Zm8 0h2v2h-1V6h-1V5Z" fill="${colors.hair.value}"/><path d="M6 5H4v2h1V6h1V5Zm8 0h2v2h-1V6h-1V5Z" fill="#000" fill-opacity=".1"/></g>`,
6
- variant09: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 6h2v1H5V6Zm8 0h2v1h-2V6Z" fill="${colors.hair.value}"/><path d="M5 6h2v1H5V6Zm8 0h2v1h-2V6Z" fill="#000" fill-opacity=".1"/></g>`,
7
- variant08: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 5h1v1h1v1H5V6h1V5Zm7 0h1v1h1v1h-3V6h1V5Z" fill="${colors.hair.value}"/><path d="M6 5h1v1h1v1H5V6h1V5Zm7 0h1v1h1v1h-3V6h1V5Z" fill="#000" fill-opacity=".1"/></g>`,
8
- variant07: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 5h2v1h1v1H8V6H6V5Zm8 0h-2v1h-1v1h1V6h2V5Z" fill="${colors.hair.value}"/><path d="M6 5h2v1h1v1H8V6H6V5Zm8 0h-2v1h-1v1h1V6h2V5Z" fill="#000" fill-opacity=".1"/></g>`,
9
- variant06: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M12 7V6h1V5h1v1h1v1h-1V6h-1v1h-1ZM5 7V6h1V5h1v1h1v1H7V6H6v1H5Z" fill="${colors.hair.value}"/><path d="M12 7V6h1V5h1v1h1v1h-1V6h-1v1h-1ZM5 7V6h1V5h1v1h1v1H7V6H6v1H5Z" fill="#000" fill-opacity=".1"/></g>`,
10
- variant05: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M7 5v1H5v1H4V6h1V5h2Zm6 0h2v1h1v1h-1V6h-2V5Z" fill="${colors.hair.value}"/><path d="M7 5v1H5v1H4V6h1V5h2Zm6 0h2v1h1v1h-1V6h-2V5Z" fill="#000" fill-opacity=".1"/></g>`,
11
- variant04: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M4 7V5h3v1H5v1H4Zm12-2v2h-1V6h-2V5h3Z" fill="${colors.hair.value}"/><path d="M4 7V5h3v1H5v1H4Zm12-2v2h-1V6h-2V5h3Z" fill="#000" fill-opacity=".1"/></g>`,
12
- variant03: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M7 5h1v1h1v1H8V6H7V5Zm6 0v1h-1v1h-1V6h1V5h1Z" fill="${colors.hair.value}"/><path d="M7 5h1v1h1v1H8V6H7V5Zm6 0v1h-1v1h-1V6h1V5h1Z" fill="#000" fill-opacity=".1"/></g>`,
13
- variant02: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M4 7V6h1V5h1v1H5v1H4Zm10-2h1v1h1v1h-1V6h-1V5Z" fill="${colors.hair.value}"/><path d="M4 7V6h1V5h1v1H5v1H4Zm10-2h1v1h1v1h-1V6h-1V5Z" fill="#000" fill-opacity=".1"/></g>`,
14
- variant01: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M7 5v1H5v1H4V6h1V5h2Zm7 0v1h-2v1h-1V6h1V5h2Z" fill="${colors.hair.value}"/><path d="M7 5v1H5v1H4V6h1V5h2Zm7 0v1h-2v1h-1V6h1V5h2Z" fill="#000" fill-opacity=".1"/></g>`,
15
- };
@@ -1,2 +0,0 @@
1
- import type { ComponentGroup } from '../types.js';
2
- export declare const hat: ComponentGroup;
@@ -1,14 +0,0 @@
1
- export const hat = {
2
- variant01: (components, colors) => `<path d="M4 1v2H2v2h16V3h-2V1H4Z" fill="${colors.hat.value}"/>`,
3
- variant02: (components, colors) => `<path d="M4 4H2v1h16V4h-2V1H4v3Z" fill="${colors.hat.value}"/>`,
4
- variant03: (components, colors) => `<path d="M3 4v2h14V4h-1V3h-1V2H5v1H4v1H3Z" fill="${colors.hat.value}"/>`,
5
- variant04: (components, colors) => `<path d="M6 1v1H5v1H4v2h14V4h-2V3h-1V2h-1V1H6Z" fill="${colors.hat.value}"/>`,
6
- variant05: (components, colors) => `<path d="M3 5V3h2V1h10v2h2v2H3Z" fill="${colors.hat.value}"/><path d="M4 1v2h12V1H4Z" fill="#fff" fill-opacity=".2"/>`,
7
- variant06: (components, colors) => `<path d="M3 5V4h2V1h10v3h2v1H3Z" fill="${colors.hat.value}"/><path d="M5 1v3h10V1H5Z" fill="#fff" fill-opacity=".2"/>`,
8
- variant07: (components, colors) => `<path d="M3 6V4h1V3h1V2h10v1h1v1h1v2H3Z" fill="${colors.hat.value}"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4 3v1h12V3H4ZM3 5v1h14V5H3Z" fill="#fff" fill-opacity=".2"/>`,
9
- variant08: (components, colors) => `<path d="M14 2H6v1H5v1H4v2h14V5h-2V4h-1V3h-1V2Z" fill="${colors.hat.value}"/><path d="M5 6h1V5h1V4h1V3H7v1H6v1H5v1Z" fill="#fff" fill-opacity=".2"/>`,
10
- variant09: (components, colors) => `<path d="M5 1v2H3v2h14V3h-2V1H5Z" fill="${colors.hat.value}"/><path d="M14 3V0h-1v3h1Z" fill="#fff" fill-opacity=".2"/>`,
11
- variant10: (components, colors) => `<path d="M4 0v5H2v1h16V5h-2V0H4Z" fill="${colors.hat.value}"/><path fill-rule="evenodd" clip-rule="evenodd" d="M15 3V0h-1v3h1Zm-2-3v2h-1V0h1Z" fill="#fff" fill-opacity=".2"/>`,
12
- variant11: (components, colors) => `<path d="M3 3v2h14V3h-1V2h-1V1H5v1H4v1H3Z" fill="${colors.hat.value}"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14 1v4h-1V1h1Zm-2 0v4h-1V1h1Z" fill="#fff" fill-opacity=".2"/>`,
13
- variant12: (components, colors) => `<path d="M5 4H4v2h14V5h-2V4h-1V3h-1V2H6v1H5v1Z" fill="${colors.hat.value}"/><path d="M14 4h-3v1h3V4Z" fill="#fff" fill-opacity=".2"/>`,
14
- };