This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertColorsToTotalBlackAndWhite(svgString) { | |
const BLACK_THRESHOLD = 128; | |
const WHITE_THRESHOLD = 127; | |
const convertColor = (color) => { | |
if (color.toLowerCase() === 'none') { | |
return color; // Leave "none" unchanged | |
} | |
const hexToDecimal = (hex) => parseInt(hex, 16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wait(milliseconds) { | |
return new Promise((resolve, reject) => { | |
setTimeout(resolve, milliseconds); | |
}); | |
} | |
function waitForSelector(selector) { | |
const wait = new Promise((resolve, reject) => { | |
let checkExist = setInterval(function () { | |
if (document.querySelector(selector)) { |