diff --git a/src/utils.js b/src/utils.js index b9aade2..6d0701c 100644 --- a/src/utils.js +++ b/src/utils.js @@ -59,8 +59,8 @@ const utils = { hex2rgb: (color) => { if (typeof color !== 'string') return [255, 0, 0]; - if (/^#[a-fA-F0-9]{3,6}$/.test(color)) { - throw new Error('#{color} isn\'t a supported hex color'); + if (!/^#[a-fA-F0-9]{3,6}$/.test(color)) { + throw new Error(`${color} isn't a supported hex color`); } color = color.substr(1);