@braineet/ui
Version:
Braineet design system
44 lines • 1.18 kB
JavaScript
var avatarFills = function avatarFills(colors) {
return {
other1: {
color: colors.other.other1.default,
backgroundColor: colors.other.other1.lighten(0.1)
},
other2: {
color: colors.other.other2.default,
backgroundColor: colors.other.other2.lighten(0.1)
},
other3: {
color: colors.other.other3.default,
backgroundColor: colors.other.other3.lighten(0.1)
},
other4: {
color: colors.other.other4.default,
backgroundColor: colors.other.other4.lighten(0.1)
},
other5: {
color: colors.other.other5.default,
backgroundColor: colors.other.other5.lighten(0.1)
},
other6: {
color: colors.other.other6.default,
backgroundColor: colors.other.other6.lighten(0.1)
}
};
};
export default (function (options, colors) {
if (options === void 0) {
options = {
color: 'automatic',
id: ''
};
}
var _options = options,
id = _options.id;
if (options.color === 'automatic') {
var keys = Object.keys(avatarFills(colors));
var key = keys[id % keys.length];
return avatarFills(colors)[key];
}
return avatarFills(colors)[options.color];
});