/
(?#https://regex101.com/r/eO8pP0/)(?(DEFINE)(?<hex>[a-fA-F\d])(?<hue>[+-]?(?:\d{1,8}(?:\.\d{0,8})?|\.\d{0,8}))(?<percent>(?:\d{1,2}|100)%)(?<channel>(?&percent)|25[0-5]|2[0-4]\d|[0-1]\d\d|\d{1,2})(?<rgb>\h*(?&channel)\h*(?:,\h*(?&channel)\h*){2})(?<hsl>\h*(?&hue)\h*(?:,\h*(?&percent)\h*){2})(?<alpha>1(?:\.0*)?|0?\.\d{1,8}|0))^(?:#(?:(?&hex){6}|(?&hex){3})|rgb\h*\((?&rgb)\)|hsl\h*\((?&hsl)\)|rgba\h*\((?&rgb),\h*(?&alpha)\h*\)|hsla\h*\((?&hsl),\h*(?&alpha)\h*\)|inherit|initial|transparent|unset|current[cC]olor|(?# Named