feat(avatar-background): Change default colors for avatar backgrounds
This commit is contained in:
parent
95e96b605d
commit
4a322d2e60
|
@ -3,15 +3,17 @@
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
const AVATAR_COLORS = [
|
const AVATAR_COLORS = [
|
||||||
'232, 105, 156',
|
'#6A50D3',
|
||||||
'255, 198, 115',
|
'#FF9B42',
|
||||||
'128, 128, 255',
|
'#DF486F',
|
||||||
'105, 232, 194',
|
'#73348C',
|
||||||
'234, 255, 128'
|
'#B23683',
|
||||||
|
'#F96E57',
|
||||||
|
'#4380E2',
|
||||||
|
'#2AA076',
|
||||||
|
'#00A8B3'
|
||||||
];
|
];
|
||||||
|
|
||||||
const AVATAR_OPACITY = 0.4;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the background color of an initials based avatar.
|
* Generates the background color of an initials based avatar.
|
||||||
*
|
*
|
||||||
|
@ -35,7 +37,7 @@ export function getAvatarColor(initials: ?string, customAvatarBackgrounds: Array
|
||||||
colorIndex = nameHash % colorsBase.length;
|
colorIndex = nameHash % colorsBase.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
return hasCustomAvatarBackgronds ? colorsBase[colorIndex] : `rgba(${colorsBase[colorIndex]}, ${AVATAR_OPACITY})`;
|
return colorsBase[colorIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue