improve robustness and responsiveness

This commit is contained in:
Henry Jameson 2024-11-12 21:10:02 +02:00
commit a2a58dc082
2 changed files with 31 additions and 15 deletions

View file

@ -112,9 +112,14 @@ export default {
},
getColorFallback () {
if (this.staticVars && this.selected?.color) {
const computedColor = findColor(this.selected.color, { dynamicVars: {}, staticVars: this.staticVars }, true)
if (computedColor) return rgb2hex(computedColor)
return null
try {
const computedColor = findColor(this.selected.color, { dynamicVars: {}, staticVars: this.staticVars }, true)
if (computedColor) return rgb2hex(computedColor)
return null
} catch (e) {
console.warn(e)
return null
}
} else {
return this.currentFallback?.color
}