@dicebear/pixel-art
Advanced tools
Comparing version 5.3.4 to 6.0.0-alpha.0
@@ -21,3 +21,3 @@ /** | ||
export const create = ({ prng, options }) => { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r; | ||
const components = getComponents({ prng, options }); | ||
@@ -31,3 +31,3 @@ const colors = getColors({ prng, options }); | ||
}, | ||
body: `<path d="M4 2h8v1h1v3h1v2h-1v3h-1v1H9v1h4v1h1v2H2v-2h1v-1h4v-1H4v-1H3V8H2V6h1V3h1V2Z" fill="${escape.xml(`${colors.skin}`)}"/><path d="M4 2h8v1h1v3h1v2h-1v3h-1v1H4v-1H3V8H2V6h1V3h1V2Z" fill="#fff" fill-opacity=".1"/>${(_b = (_a = components.accessories) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}${(_d = (_c = components.clothing) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}${(_f = (_e = components.eyes) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}${(_h = (_g = components.glasses) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}${(_k = (_j = components.beard) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}${(_m = (_l = components.mouth) === null || _l === void 0 ? void 0 : _l.value(components, colors)) !== null && _m !== void 0 ? _m : ''}${(_p = (_o = components.hair) === null || _o === void 0 ? void 0 : _o.value(components, colors)) !== null && _p !== void 0 ? _p : ''}`, | ||
body: `<path d="M4 2h8v1h1v3h1v2h-1v3h-1v1H9v1h4v1h1v2H2v-2h1v-1h4v-1H4v-1H3V8H2V6h1V3h1V2Z" fill="${escape.xml(`${colors.skin}`)}"/><path d="M4 2h8v1h1v3h1v2h-1v3h-1v1H4v-1H3V8H2V6h1V3h1V2Z" fill="#fff" fill-opacity=".1"/>${(_b = (_a = components.accessories) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}${(_d = (_c = components.clothing) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}${(_f = (_e = components.eyes) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}${(_h = (_g = components.glasses) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}${(_k = (_j = components.beard) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}${(_m = (_l = components.mouth) === null || _l === void 0 ? void 0 : _l.value(components, colors)) !== null && _m !== void 0 ? _m : ''}${(_p = (_o = components.hair) === null || _o === void 0 ? void 0 : _o.value(components, colors)) !== null && _p !== void 0 ? _p : ''}${(_r = (_q = components.hat) === null || _q === void 0 ? void 0 : _q.value(components, colors)) !== null && _r !== void 0 ? _r : ''}`, | ||
extra: () => ({ | ||
@@ -34,0 +34,0 @@ ...Object.entries(components).reduce((acc, [key, value]) => { |
@@ -9,10 +9,10 @@ /** | ||
export const beard = { | ||
'variant08': (components, colors) => `<path opacity=".9" d="M3 6h1v3h8V6h1v5h-1v1H4v-1H3V6Z" fill="${escape.xml(`${colors.hair}`)}"/>`, | ||
'variant07': (components, colors) => `<path opacity=".9" d="M3 9v2h1v1h8v-1h1V9H3Z" fill="${escape.xml(`${colors.hair}`)}"/>`, | ||
'variant06': (components, colors) => `<path opacity=".9" d="M3 9h3v1h4V9h3v2h-1v1H4v-1H3V9Z" fill="${escape.xml(`${colors.hair}`)}"/>`, | ||
'variant05': (components, colors) => `<path opacity=".9" d="M3 6h1v2h1v1h6V8h1V6h1v5h-1v1H4v-1H3V6Z" fill="${escape.xml(`${colors.hair}`)}"/>`, | ||
'variant04': (components, colors) => `<path opacity=".9" fill="${escape.xml(`${colors.hair}`)}" d="M6 11h4v1H6z"/>`, | ||
'variant03': (components, colors) => `<path opacity=".9" d="M3 9h2v1h6V9h2v2h-1v2h-1v1H5v-1H4v-2H3V9Z" fill="${escape.xml(`${colors.hair}`)}"/>`, | ||
'variant02': (components, colors) => `<path opacity=".9" d="M5 11h6v1h-1v1H9v1H7v-1H6v-1H5v-1Z" fill="${escape.xml(`${colors.hair}`)}"/>`, | ||
'variant01': (components, colors) => `<path opacity=".9" d="M3 8h2v1h1v1h4V9h1V8h2v3h-1v1H4v-1H3V8Z" fill="${escape.xml(`${colors.hair}`)}"/>`, | ||
'variant08': (components, colors) => `<mask id="beardVariant08-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="3" y="6" width="10" height="6"><path opacity=".9" d="M3 6h1v3h8V6h1v5h-1v1H4v-1H3V6Z" fill="${escape.xml(`${colors.hair}`)}"/></mask><g mask="url(#beardVariant08-a)"><path fill="${escape.xml(`${colors.hair}`)}" d="M0 0h16v16H0z"/><path fill="#fff" fill-opacity=".3" d="M0 0h16v16H0z"/></g>`, | ||
'variant07': (components, colors) => `<mask id="beardVariant07-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="3" y="9" width="10" height="3"><path opacity=".9" d="M3 9v2h1v1h8v-1h1V9H3Z" fill="${escape.xml(`${colors.hair}`)}"/></mask><g mask="url(#beardVariant07-a)"><path fill="${escape.xml(`${colors.hair}`)}" d="M0 0h16v16H0z"/><path fill="#fff" fill-opacity=".3" d="M0 0h16v16H0z"/></g>`, | ||
'variant06': (components, colors) => `<mask id="beardVariant06-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="3" y="9" width="10" height="3"><path opacity=".9" d="M3 9h3v1h4V9h3v2h-1v1H4v-1H3V9Z" fill="${escape.xml(`${colors.hair}`)}"/></mask><g mask="url(#beardVariant06-a)"><path fill="${escape.xml(`${colors.hair}`)}" d="M0 0h16v16H0z"/><path fill="#fff" fill-opacity=".3" d="M0 0h16v16H0z"/></g>`, | ||
'variant05': (components, colors) => `<mask id="beardVariant05-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="3" y="6" width="10" height="6"><path opacity=".9" d="M3 6h1v2h1v1h6V8h1V6h1v5h-1v1H4v-1H3V6Z" fill="${escape.xml(`${colors.hair}`)}"/></mask><g mask="url(#beardVariant05-a)"><path fill="${escape.xml(`${colors.hair}`)}" d="M0 0h16v16H0z"/><path fill="#fff" fill-opacity=".3" d="M0 0h16v16H0z"/></g>`, | ||
'variant04': (components, colors) => `<mask id="beardVariant04-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="6" y="11" width="4" height="1"><path opacity=".9" fill="${escape.xml(`${colors.hair}`)}" d="M6 11h4v1H6z"/></mask><g mask="url(#beardVariant04-a)"><path fill="${escape.xml(`${colors.hair}`)}" d="M0 0h16v16H0z"/><path fill="#fff" fill-opacity=".3" d="M0 0h16v16H0z"/></g>`, | ||
'variant03': (components, colors) => `<mask id="beardVariant03-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="3" y="9" width="10" height="5"><path opacity=".9" d="M3 9h2v1h6V9h2v2h-1v2h-1v1H5v-1H4v-2H3V9Z" fill="${escape.xml(`${colors.hair}`)}"/></mask><g mask="url(#beardVariant03-a)"><path fill="${escape.xml(`${colors.hair}`)}" d="M0 0h16v16H0z"/><path fill="#fff" fill-opacity=".3" d="M0 0h16v16H0z"/></g>`, | ||
'variant02': (components, colors) => `<mask id="beardVariant02-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="5" y="11" width="6" height="3"><path opacity=".9" d="M5 11h6v1h-1v1H9v1H7v-1H6v-1H5v-1Z" fill="${escape.xml(`${colors.hair}`)}"/></mask><g mask="url(#beardVariant02-a)"><path fill="${escape.xml(`${colors.hair}`)}" d="M0 0h16v16H0z"/><path fill="#fff" fill-opacity=".3" d="M0 0h16v16H0z"/></g>`, | ||
'variant01': (components, colors) => `<mask id="beardVariant01-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="3" y="8" width="10" height="4"><path opacity=".9" d="M3 8h2v1h1v1h4V9h1V8h2v3h-1v1H4v-1H3V8Z" fill="${escape.xml(`${colors.hair}`)}"/></mask><g mask="url(#beardVariant01-a)"><path fill="${escape.xml(`${colors.hair}`)}" d="M0 0h16v16H0z"/><path fill="#fff" fill-opacity=".3" d="M0 0h16v16H0z"/></g>`, | ||
}; |
@@ -14,1 +14,2 @@ /** | ||
export { hair } from './hair.js'; | ||
export { hat } from './hat.js'; |
@@ -14,1 +14,2 @@ /** | ||
export { hair } from './hair.js'; | ||
export { hat } from './hat.js'; |
@@ -21,3 +21,3 @@ /** | ||
export const create = ({ prng, options }) => { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r; | ||
const components = getComponents({ prng, options }); | ||
@@ -31,3 +31,3 @@ const colors = getColors({ prng, options }); | ||
}, | ||
body: `<path d="M4 2h8v1h1v3h1v2h-1v3h-1v1H9v1h4v1h1v2H2v-2h1v-1h4v-1H4v-1H3V8H2V6h1V3h1V2Z" fill="${escape.xml(`${colors.skin}`)}"/><path d="M4 2h8v1h1v3h1v2h-1v3h-1v1H4v-1H3V8H2V6h1V3h1V2Z" fill="#fff" fill-opacity=".1"/>${(_b = (_a = components.accessories) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}${(_d = (_c = components.clothing) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}${(_f = (_e = components.eyes) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}${(_h = (_g = components.glasses) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}${(_k = (_j = components.beard) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}${(_m = (_l = components.mouth) === null || _l === void 0 ? void 0 : _l.value(components, colors)) !== null && _m !== void 0 ? _m : ''}${(_p = (_o = components.hair) === null || _o === void 0 ? void 0 : _o.value(components, colors)) !== null && _p !== void 0 ? _p : ''}`, | ||
body: `<path d="M4 2h8v1h1v3h1v2h-1v3h-1v1H9v1h4v1h1v2H2v-2h1v-1h4v-1H4v-1H3V8H2V6h1V3h1V2Z" fill="${escape.xml(`${colors.skin}`)}"/><path d="M4 2h8v1h1v3h1v2h-1v3h-1v1H4v-1H3V8H2V6h1V3h1V2Z" fill="#fff" fill-opacity=".1"/>${(_b = (_a = components.accessories) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}${(_d = (_c = components.clothing) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}${(_f = (_e = components.eyes) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}${(_h = (_g = components.glasses) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}${(_k = (_j = components.beard) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}${(_m = (_l = components.mouth) === null || _l === void 0 ? void 0 : _l.value(components, colors)) !== null && _m !== void 0 ? _m : ''}${(_p = (_o = components.hair) === null || _o === void 0 ? void 0 : _o.value(components, colors)) !== null && _p !== void 0 ? _p : ''}${(_r = (_q = components.hat) === null || _q === void 0 ? void 0 : _q.value(components, colors)) !== null && _r !== void 0 ? _r : ''}`, | ||
extra: () => ({ | ||
@@ -34,0 +34,0 @@ ...Object.entries(components).reduce((acc, [key, value]) => { |
@@ -385,2 +385,54 @@ /** | ||
}, | ||
"hat": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"enum": [ | ||
"variant10", | ||
"variant09", | ||
"variant08", | ||
"variant07", | ||
"variant06", | ||
"variant05", | ||
"variant04", | ||
"variant03", | ||
"variant02", | ||
"variant01" | ||
] | ||
}, | ||
"default": [ | ||
"variant10", | ||
"variant09", | ||
"variant08", | ||
"variant07", | ||
"variant06", | ||
"variant05", | ||
"variant04", | ||
"variant03", | ||
"variant02", | ||
"variant01" | ||
] | ||
}, | ||
"hatColor": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"pattern": "^(transparent|[a-fA-F0-9]{6})$" | ||
}, | ||
"default": [ | ||
"2e1e05", | ||
"2663a3", | ||
"989789", | ||
"3d8a6b", | ||
"cc6192", | ||
"614f8a", | ||
"a62116" | ||
] | ||
}, | ||
"hatProbability": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"maximum": 100, | ||
"default": 5 | ||
}, | ||
"mouth": { | ||
@@ -387,0 +439,0 @@ "type": "array", |
@@ -18,2 +18,4 @@ /** | ||
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')[]; | ||
hat?: ('variant10' | 'variant09' | 'variant08' | 'variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[]; | ||
hatProbability?: number; | ||
accessoriesColor?: string[]; | ||
@@ -24,2 +26,3 @@ clothingColor?: string[]; | ||
hairColor?: string[]; | ||
hatColor?: string[]; | ||
mouthColor?: string[]; | ||
@@ -26,0 +29,0 @@ skinColor?: string[]; |
@@ -9,3 +9,3 @@ /** | ||
export function getColors({ prng, options }) { | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
return { | ||
@@ -17,6 +17,7 @@ 'accessories': convertColor(prng.pick((_a = options.accessoriesColor) !== null && _a !== void 0 ? _a : [], 'transparent')), | ||
'hair': convertColor(prng.pick((_e = options.hairColor) !== null && _e !== void 0 ? _e : [], 'transparent')), | ||
'mouth': convertColor(prng.pick((_f = options.mouthColor) !== null && _f !== void 0 ? _f : [], 'transparent')), | ||
'skin': convertColor(prng.pick((_g = options.skinColor) !== null && _g !== void 0 ? _g : [], 'transparent')), | ||
'hat': convertColor(prng.pick((_f = options.hatColor) !== null && _f !== void 0 ? _f : [], 'transparent')), | ||
'mouth': convertColor(prng.pick((_g = options.mouthColor) !== null && _g !== void 0 ? _g : [], 'transparent')), | ||
'skin': convertColor(prng.pick((_h = options.skinColor) !== null && _h !== void 0 ? _h : [], 'transparent')), | ||
}; | ||
} | ||
; |
@@ -12,3 +12,3 @@ /** | ||
group: 'accessories', | ||
values: options.accessories | ||
values: options.accessories, | ||
}); | ||
@@ -18,3 +18,3 @@ const clothingComponent = pickComponent({ | ||
group: 'clothing', | ||
values: options.clothing | ||
values: options.clothing, | ||
}); | ||
@@ -24,3 +24,3 @@ const eyesComponent = pickComponent({ | ||
group: 'eyes', | ||
values: options.eyes | ||
values: options.eyes, | ||
}); | ||
@@ -30,3 +30,3 @@ const glassesComponent = pickComponent({ | ||
group: 'glasses', | ||
values: options.glasses | ||
values: options.glasses, | ||
}); | ||
@@ -36,3 +36,3 @@ const beardComponent = pickComponent({ | ||
group: 'beard', | ||
values: options.beard | ||
values: options.beard, | ||
}); | ||
@@ -42,3 +42,3 @@ const mouthComponent = pickComponent({ | ||
group: 'mouth', | ||
values: options.mouth | ||
values: options.mouth, | ||
}); | ||
@@ -48,4 +48,9 @@ const hairComponent = pickComponent({ | ||
group: 'hair', | ||
values: options.hair | ||
values: options.hair, | ||
}); | ||
const hatComponent = pickComponent({ | ||
prng, | ||
group: 'hat', | ||
values: options.hat, | ||
}); | ||
return { | ||
@@ -59,4 +64,5 @@ 'accessories': prng.bool(options.accessoriesProbability) ? accessoriesComponent : undefined, | ||
'hair': hairComponent, | ||
'hat': prng.bool(options.hatProbability) ? hatComponent : undefined, | ||
}; | ||
} | ||
; |
{ | ||
"name": "@dicebear/pixel-art", | ||
"version": "5.3.4", | ||
"version": "6.0.0-alpha.0", | ||
"description": "Avatar style for DiceBear", | ||
@@ -32,13 +32,13 @@ "keywords": [ | ||
"devDependencies": { | ||
"@dicebear/core": "5.3.4", | ||
"@tsconfig/recommended": "^1.0.1", | ||
"@dicebear/core": "6.0.0-alpha.0", | ||
"@tsconfig/recommended": "^1.0.2", | ||
"del-cli": "^5.0.0", | ||
"typescript": "^4.6.3", | ||
"uvu": "^0.5.3" | ||
"typescript": "^5.0.2", | ||
"uvu": "^0.5.6" | ||
}, | ||
"peerDependencies": { | ||
"@dicebear/core": "^5.0.0" | ||
"@dicebear/core": "^6.0.0" | ||
}, | ||
"engines": { | ||
"node": "^14.13.1 || >=16.0.0" | ||
"node": ">=16.0.0" | ||
}, | ||
@@ -48,3 +48,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "923fd5f3ba29d50959fb4f82364e98973f822701" | ||
"gitHead": "64646747611ff92b5028205ef3e509be5ff2060b" | ||
} |
@@ -8,9 +8,9 @@ <h1 align="center"><img src="https://dicebear.com/logo-readme.svg" width="96" /> <br />DiceBear Pixel Art</h1> | ||
<p align="center"> | ||
<img src="https://api.dicebear.com/5.x/pixel-art/svg?seed=Mimi" width="64" /> | ||
<img src="https://api.dicebear.com/5.x/pixel-art/svg?seed=Sasha" width="64" /> | ||
<img src="https://api.dicebear.com/5.x/pixel-art/svg?seed=Lilly" width="64" /> | ||
<img src="https://api.dicebear.com/5.x/pixel-art/svg?seed=Tigger" width="64" /> | ||
<img src="https://api.dicebear.com/5.x/pixel-art/svg?seed=Bella" width="64" /> | ||
<img src="https://api.dicebear.com/5.x/pixel-art/svg?seed=Zoe" width="64" /> | ||
<img src="https://api.dicebear.com/5.x/pixel-art/svg?seed=Kitty" width="64" /> | ||
<img src="https://api.dicebear.com/6.x/pixel-art/svg?seed=Mimi" width="64" /> | ||
<img src="https://api.dicebear.com/6.x/pixel-art/svg?seed=Sasha" width="64" /> | ||
<img src="https://api.dicebear.com/6.x/pixel-art/svg?seed=Lilly" width="64" /> | ||
<img src="https://api.dicebear.com/6.x/pixel-art/svg?seed=Tigger" width="64" /> | ||
<img src="https://api.dicebear.com/6.x/pixel-art/svg?seed=Bella" width="64" /> | ||
<img src="https://api.dicebear.com/6.x/pixel-art/svg?seed=Zoe" width="64" /> | ||
<img src="https://api.dicebear.com/6.x/pixel-art/svg?seed=Kitty" width="64" /> | ||
</p> | ||
@@ -17,0 +17,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69560
36
1190
2