Fix: invert test and fix error message

pull/46/head
Christian Paul 2018-10-18 00:38:10 -07:00
rodzic 25ce95a8b3
commit 46dd1a9853
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -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);