Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function changeThemeColor(newColor, oldColor) {
var options = {
primary: {
oldColor: oldColor || appConfig.themeColor,
newColor: newColor,
},
cssUrl: appConfig.themeFile,
others: {
oldColors: ['#0cdd3a', '#c655dd'],
newColors: ['#ff0000', '#ffff00'],
}
}
try {
replacer.elementUI.changeColor(options);
localStorage.setItem('theme_color', newColor)
} catch (e) {
console.error(e)
}
}