regexValidHslColor top-level constant

String const regexValidHslColor

Legacy hsl()/hsla() regex - updated to handle all valid space combinations and Allow zero or more spaces before and after the comma.

Implementation

const regexValidHslColor = r'^hsla?\s*\(\s*'
    r'([0-9]+(?:\.[0-9]+)?(?:deg|rad|turn|grad)?)'
    '$regexComponentSeparator'
    '((?:100|[0-9]{1,2})%)'
    '$regexComponentSeparator'
    '((?:100|[0-9]{1,2})%)'
    r'(?:,\s*((?:0?\.\d+|1|0)))?'
    r'\s*\)$';