mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 09:43:10 +00:00
merge
This commit is contained in:
commit
4e0034124b
|
|
@ -40,7 +40,11 @@ const getAvatarColour = (name: string) => {
|
|||
'#7F3BF5',
|
||||
'#8F959E'
|
||||
]
|
||||
let charIndex = name ? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65 : 0
|
||||
let charIndex = name
|
||||
? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65 >= 0
|
||||
? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65
|
||||
: 0
|
||||
: 0
|
||||
|
||||
function getColor() {
|
||||
return colours[Math.abs(charIndex % colours.length)]
|
||||
|
|
|
|||
Loading…
Reference in New Issue