diff --git a/src/util/cast.js b/src/util/cast.js index ab7c274c1..49c189039 100644 --- a/src/util/cast.js +++ b/src/util/cast.js @@ -93,6 +93,9 @@ class Cast { let color; if (typeof value === 'string' && value.substring(0, 1) === '#') { color = Color.hexToRgb(value); + + // If the color wasn't *actually* a hex color, cast to black + if (!color) color = {r: 0, g: 0, b: 0, a: 255}; } else { color = Color.decimalToRgb(Cast.toNumber(value)); }