var name refine
This commit is contained in:
parent
42baabc0e1
commit
877e56d81c
1 changed files with 3 additions and 3 deletions
|
|
@ -31,10 +31,10 @@ const stringToColour = (str) => {
|
|||
str.split('').forEach(char => {
|
||||
hash = char.charCodeAt(0) + ((hash << 5) - hash)
|
||||
})
|
||||
let colour = '#'
|
||||
let color = '#';
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const value = (hash >> (i * 8)) & 0xff
|
||||
colour += value.toString(16).padStart(2, '0')
|
||||
color += value.toString(16).padStart(2, '0')
|
||||
}
|
||||
return colour
|
||||
return color;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue