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
|
let charIndex = name ? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65 : 0
|
||||||
|
|
||||||
function getColor() {
|
function getColor() {
|
||||||
if (!colours[charIndex]) {
|
return colours[Math.abs(charIndex % colours.length)]
|
||||||
charIndex -= 10
|
|
||||||
getColor()
|
|
||||||
}
|
|
||||||
return colours[charIndex]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return getColor()
|
return getColor()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user