diff --git a/framework/core/js/src/common/utils/isDark.ts b/framework/core/js/src/common/utils/isDark.ts index 03755a8e8..3b4563ee7 100644 --- a/framework/core/js/src/common/utils/isDark.ts +++ b/framework/core/js/src/common/utils/isDark.ts @@ -6,16 +6,16 @@ */ export default function isDark(hexcolor: String) { - let hexnumbers = hexcolor.replace("#", ""); + let hexnumbers = hexcolor.replace('#', ''); if (hexnumbers.length == 3) { hexnumbers += hexnumbers; } - const r = parseInt(hexnumbers.substr(0,2),16); - const g = parseInt(hexnumbers.substr(2,2),16); - const b = parseInt(hexnumbers.substr(4,2),16); - const yiq = ((r*299)+(g*587)+(b*114))/1000; + const r = parseInt(hexnumbers.substr(0, 2), 16); + const g = parseInt(hexnumbers.substr(2, 2), 16); + const b = parseInt(hexnumbers.substr(4, 2), 16); + const yiq = (r * 299 + g * 587 + b * 114) / 1000; - return (yiq >= 128) ? false : true; + return yiq >= 128 ? false : true; }