@braineet/ui
Version:
Braineet design system
48 lines (47 loc) • 1.27 kB
JavaScript
;
exports.__esModule = true;
exports.default = void 0;
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)
}
};
};
var _default = exports.default = function _default(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];
};