mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
use slice instead of substring for desired result
This commit is contained in:
parent
0cb14f3f6c
commit
e8a30e7251
1 changed files with 1 additions and 1 deletions
|
|
@ -74,7 +74,7 @@ export function stringToColor(str) {
|
||||||
let color = '#';
|
let color = '#';
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 3; i++) {
|
||||||
let value = (hash >> (i * 8)) & 0xff;
|
let value = (hash >> (i * 8)) & 0xff;
|
||||||
color += ('00' + value.toString(16)).substring(-2);
|
color += ('00' + value.toString(16)).slice(-2);
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue