fix: 应用icon颜色
This commit is contained in:
parent
8726230a26
commit
42eacb5795
@ -43,11 +43,7 @@ const getAvatarColour = (name: string) => {
|
||||
let charIndex = name ? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65 : 0
|
||||
|
||||
function getColor() {
|
||||
if (!colours[charIndex]) {
|
||||
charIndex -= 10
|
||||
getColor()
|
||||
}
|
||||
return colours[charIndex]
|
||||
return colours[Math.abs(charIndex % colours.length)]
|
||||
}
|
||||
|
||||
return getColor()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user