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;