mirror of
https://github.com/rastapasta/mapscii.git
synced 2024-11-21 23:53:08 +01:00
Fix: invert test and fix error message
This commit is contained in:
parent
25ce95a8b3
commit
46dd1a9853
@ -59,8 +59,8 @@ const utils = {
|
|||||||
hex2rgb: (color) => {
|
hex2rgb: (color) => {
|
||||||
if (typeof color !== 'string') return [255, 0, 0];
|
if (typeof color !== 'string') return [255, 0, 0];
|
||||||
|
|
||||||
if (/^#[a-fA-F0-9]{3,6}$/.test(color)) {
|
if (!/^#[a-fA-F0-9]{3,6}$/.test(color)) {
|
||||||
throw new Error('#{color} isn\'t a supported hex color');
|
throw new Error(`${color} isn't a supported hex color`);
|
||||||
}
|
}
|
||||||
|
|
||||||
color = color.substr(1);
|
color = color.substr(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user