From ac093d6a51559128d47a79dcf58a1f2d981a9fd5 Mon Sep 17 00:00:00 2001 From: Daniil Tsivinsky Date: Sat, 21 Feb 2026 22:10:47 +0300 Subject: [PATCH] replace deprecated function --- web/src/getContrastYIQ.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/getContrastYIQ.ts b/web/src/getContrastYIQ.ts index 2d0b214..48e715f 100644 --- a/web/src/getContrastYIQ.ts +++ b/web/src/getContrastYIQ.ts @@ -13,9 +13,9 @@ export function getContrastYIQ(hexcolor: string) { } // Parse RGB values - const r = parseInt(hexcolor.substr(0, 2), 16); - const g = parseInt(hexcolor.substr(2, 2), 16); - const b = parseInt(hexcolor.substr(4, 2), 16); + const r = parseInt(hexcolor.substring(0, 2), 16); + const g = parseInt(hexcolor.substring(2, 2), 16); + const b = parseInt(hexcolor.substring(4, 2), 16); // Calculate YIQ brightness const yiq = (r * 299 + g * 587 + b * 114) / 1000;