fix string 2 hex to not use deprecated substr
This commit is contained in:
parent
453fe177b9
commit
7d798e9511
1 changed files with 1 additions and 1 deletions
|
@ -15,7 +15,7 @@ export default function string2hex(str: string): string {
|
||||||
const minBrightness = 0x80
|
const minBrightness = 0x80
|
||||||
const value =
|
const value =
|
||||||
(((hash >> (i * 8)) & 0xff) % (0xff - minBrightness)) + minBrightness
|
(((hash >> (i * 8)) & 0xff) % (0xff - minBrightness)) + minBrightness
|
||||||
color += ('00' + value.toString(16)).substr(-2)
|
color += ('00' + value.toString(16)).slice(-2)
|
||||||
}
|
}
|
||||||
|
|
||||||
return color
|
return color
|
||||||
|
|
Loading…
Reference in a new issue