replace deprecated function

This commit is contained in:
2026-02-21 22:10:47 +03:00
parent e1e5a8451a
commit ac093d6a51

View File

@@ -13,9 +13,9 @@ export function getContrastYIQ(hexcolor: string) {
} }
// Parse RGB values // Parse RGB values
const r = parseInt(hexcolor.substr(0, 2), 16); const r = parseInt(hexcolor.substring(0, 2), 16);
const g = parseInt(hexcolor.substr(2, 2), 16); const g = parseInt(hexcolor.substring(2, 2), 16);
const b = parseInt(hexcolor.substr(4, 2), 16); const b = parseInt(hexcolor.substring(4, 2), 16);
// Calculate YIQ brightness // Calculate YIQ brightness
const yiq = (r * 299 + g * 587 + b * 114) / 1000; const yiq = (r * 299 + g * 587 + b * 114) / 1000;