color2k icon indicating copy to clipboard operation
color2k copied to clipboard

Support space separated rgb values

Open superMDguy opened this issue 2 years ago • 3 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

superMDguy avatar Nov 01 '22 19:11 superMDguy

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.

ricokahler avatar Feb 10 '23 17:02 ricokahler

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

superMDguy avatar Feb 10 '23 17:02 superMDguy

I ran over a similar problem but with hsl

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

jnvoigt avatar May 04 '23 09:05 jnvoigt