From 7d798e9511d5e49837cbc555cd934e1827773aa0 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 15 Feb 2024 13:17:46 -0800 Subject: [PATCH] fix string 2 hex to not use deprecated substr --- src/app/utils/string2hex.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/utils/string2hex.ts b/src/app/utils/string2hex.ts index f722262..86e797a 100644 --- a/src/app/utils/string2hex.ts +++ b/src/app/utils/string2hex.ts @@ -15,7 +15,7 @@ export default function string2hex(str: string): string { const minBrightness = 0x80 const value = (((hash >> (i * 8)) & 0xff) % (0xff - minBrightness)) + minBrightness - color += ('00' + value.toString(16)).substr(-2) + color += ('00' + value.toString(16)).slice(-2) } return color