neoclide / coc-highlight

Document highlight and document colors LSP support for coc.nvim
226 stars 12 forks source link

HSL Color Issues #24

Closed ruler501 closed 3 years ago

ruler501 commented 4 years ago

It appears that HSL can only be parsed as /hsla?\(\d{1,3},\s*\d{1,3}%,\s*\d{1,3}%(,\s*\d{1,3})\) which is more restrictive than the current regex which leads to many errors being dumped to the console and it being unclear to the user what format they need to input for highlighting. It would be useful if there was support for much laxer constraints, enabling floating point input which is common in HSL and HSV since RGB rarely translates exactly to integers, and additional color models like HSV(K), CMYK, etc.

I can probably submit a PR fixing the console errors currently by just making the regex less lax if that is desirable.