ricokahler / color2k

a color parsing and manipulation lib served in roughly 2kB

Home Page:https://color2k.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support space separated rgb values

superMDguy opened this issue · comments

Example:

color2k.parseToRgba('rgb(255 235 235 / .18)') // (index):139 Uncaught Error: Failed to parse color

This should work with the new CSS Color Module Level 4

Do you know what the browser support is for that syntax? I'm not familiar with this notation but if browsers support this, this lib should probably too.

It's pretty well supported. I haven't seen it much, but had another library that was outputting colors in that format and needed to convert them to rgba

I ran over a similar problem but with hsl

when looking into MDN the comma-separated notation is considered to be legacy
MDN- HSL