1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

chore: format js

This commit is contained in:
Ian Morland
2022-11-07 11:30:01 +00:00
parent 8fe09815f5
commit 06963df407

View File

@@ -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;
}