diff --git a/index.js b/index.js index 5746537..30e3ba8 100644 --- a/index.js +++ b/index.js @@ -129,12 +129,12 @@ function assembleStyles() { }, hexToRgb: { value: hex => { - const matches = /(?[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16)); + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); if (!matches) { return [0, 0, 0]; } - let {colorString} = matches.groups; + let [colorString] = matches; if (colorString.length === 3) { colorString = [...colorString].map(character => character + character).join('');