don't shit the bed if can't find a color

This commit is contained in:
Henry Jameson 2024-10-29 23:55:44 +02:00
parent 369ac726c0
commit 1873c75a7f

View file

@ -523,9 +523,14 @@ export default {
})
exports.computeColor = (color) => {
const computedColor = findColor(color, { dynamicVars: dynamicVars.value, staticVars: staticVars.value })
if (computedColor) {
return rgb2hex(computedColor)
let computedColor
try {
computedColor = findColor(color, { dynamicVars: dynamicVars.value, staticVars: staticVars.value })
if (computedColor) {
return rgb2hex(computedColor)
}
} catch (e) {
console.warn(e)
}
return null
}