diff --git a/src/shared/color.js b/src/shared/color.js index e0198241ba10eb354f4816f9d6ea12be0f3fa2ad..8519e3e12ab674e907754220a429128ed4288f75 100644 --- a/src/shared/color.js +++ b/src/shared/color.js @@ -7,8 +7,12 @@ export function hexToRgba (hex) { r = hex.substring(0, 2) g = hex.substring(2, 4) b = hex.substring(4, 6) - } else { - return false + } else if (hex.length === 3) { + r = hex.substring(0, 1) + g = hex.substring(1, 2) + b = hex.substring(2, 3) + } else { + return false } if (r.length === 1) { r += r