@dicebear/adventurer
Version:
Avatar style for DiceBear
66 lines (65 loc) • 1.9 kB
JavaScript
/**
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
*
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
* File: https://www.figma.com/file/XXfL2r5Wylk623KpxDt7gO
*/
import { pickComponent } from './pickComponent.js';
export function getComponents({ prng, options, }) {
const baseComponent = pickComponent({
prng,
group: 'base',
values: options.base,
});
const eyesComponent = pickComponent({
prng,
group: 'eyes',
values: options.eyes,
});
const eyebrowsComponent = pickComponent({
prng,
group: 'eyebrows',
values: options.eyebrows,
});
const mouthComponent = pickComponent({
prng,
group: 'mouth',
values: options.mouth,
});
const featuresComponent = pickComponent({
prng,
group: 'features',
values: options.features,
});
const glassesComponent = pickComponent({
prng,
group: 'glasses',
values: options.glasses,
});
const hairComponent = pickComponent({
prng,
group: 'hair',
values: options.hair,
});
const earringsComponent = pickComponent({
prng,
group: 'earrings',
values: options.earrings,
});
return {
base: baseComponent,
eyes: eyesComponent,
eyebrows: eyebrowsComponent,
mouth: mouthComponent,
features: prng.bool(options.featuresProbability)
? featuresComponent
: undefined,
glasses: prng.bool(options.glassesProbability)
? glassesComponent
: undefined,
hair: prng.bool(options.hairProbability) ? hairComponent : undefined,
earrings: prng.bool(options.earringsProbability)
? earringsComponent
: undefined,
};
}