77
}
78
80
>
if (!range || matches.length !== 1) {
81
return;
82
}
84
>
const captureGroups = match.values();
85
>
const parsedRegex = _parseCaptureGroups(captureGroups);
86
>
const colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));
87
>
return {
88
>
range: range,
89
>
color: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)
90
>
};
91
>
}
92
93
function _findMatches(model: IDocumentColorComputerTarget | string, regex: RegExp): RegExpMatchArray[] {