From d883cf794067c5852750f861948c2be883f38382 Mon Sep 17 00:00:00 2001 From: Ananth Venkatesh <46249765+quantum9Innovation@users.noreply.github.com> Date: Thu, 15 Feb 2024 21:17:36 +0000 Subject: [PATCH] Fix string to hex conversion --- src/app/utils/string2hex.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/utils/string2hex.ts b/src/app/utils/string2hex.ts index f722262..691c31d 100644 --- a/src/app/utils/string2hex.ts +++ b/src/app/utils/string2hex.ts @@ -12,10 +12,10 @@ export default function string2hex(str: string): string { for (let i = 0; i < 3; i++) { // Ensuring minimum brightness for each component to make text stand out // Adjust the minimum brightness as needed (e.g., 0x80 for brighter colors) - const minBrightness = 0x80 + const minBrightness = 0xa0 // Increased min brightness 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