SOURCE

let str = '<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="464px" height="442px" viewBox="0 0 464 442" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>条形图10</title><desc>Created with Sketch.</desc><defs></defs><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="条形图10" transform="translate(7.000000, 0.104121)"><path d="M41.89175,405.880789 L107.27675,405.880789 L107.27675,307.986031 L41.89175,307.986031 L41.89175,405.880789 Z M235.32425,405.880789 L300.70925,405.880789 L300.70925,114.174278 L235.32425,114.174278 L235.32425,405.880789 Z" id="Combined-Shape" fill="#FDD65A"></path><path d="M332.0405,405.880789 L397.4255,405.880789 L397.4255,183.25632 L332.0405,183.25632 L332.0405,405.880789 Z M138.608,405.880789 L203.993,405.880789 L203.993,258.418067 L138.608,258.418067 L138.608,405.880789 Z" id="Combined-Shape" fill="#1BA9B1"></path><path d="M138.608,378.847608 L203.993,378.847608 L203.993,219.295304 L138.608,219.295304 L138.608,378.847608 Z M332.0405,405.880789 L397.4255,405.880789 L397.4255,240.697041 L332.0405,240.697041 L332.0405,405.880789 Z" id="Combined-Shape" fill="#0F5B8A"></path><path d="M41.89175,385.607593 L107.27675,385.607593 L107.27675,279.882876 L41.89175,279.882876 L41.89175,385.607593 Z M235.32425,405.880789 L300.70925,405.880789 L300.70925,169.740856 L235.32425,169.740856 L235.32425,405.880789 Z" id="Combined-Shape" fill="#FA902C"></path><polyline id="Stroke-62" stroke="#394046" stroke-width="13.698" points="456.084125 434.31282 0.312875 434.31282 0.312875 0.205128866"></polyline></g></g></svg>'

var reg = /"#(.*?)"/g, arr = [], match;
while (match = reg.exec(str))
    arr.push(match[1]);
console.log(arr);



let colorScheme = {
    "#FDD65A": "#cc3202",
    "#1BA9B1": "#aaaaaa",
    "#0F5B8A": "#bbbbbb",
    "#FA902C": "#cccccc",
    "#394046": "#ddddd"
}

for (var key in colorScheme) {
    var item = colorScheme[key];
    console.info(item)
    str = str.replace(eval("/" + key + "/g"), item)

}
console.info(str)
console 命令行工具 X clear

                    
>
console