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,10 +523,15 @@ export default {
}) })
exports.computeColor = (color) => { exports.computeColor = (color) => {
const computedColor = findColor(color, { dynamicVars: dynamicVars.value, staticVars: staticVars.value }) let computedColor
try {
computedColor = findColor(color, { dynamicVars: dynamicVars.value, staticVars: staticVars.value })
if (computedColor) { if (computedColor) {
return rgb2hex(computedColor) return rgb2hex(computedColor)
} }
} catch (e) {
console.warn(e)
}
return null return null
} }
provide('computeColor', exports.computeColor) provide('computeColor', exports.computeColor)