From 06963df4079373fc8fc51b7479e9576f02beb098 Mon Sep 17 00:00:00 2001 From: Ian Morland Date: Mon, 7 Nov 2022 11:30:01 +0000 Subject: [PATCH] chore: format js --- framework/core/js/src/common/utils/isDark.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; }