chroma.js icon indicating copy to clipboard operation
chroma.js copied to clipboard

`transparent` keyword missing

Open markov00 opened this issue 3 years ago • 3 comments

Hi, it seems that the transparent keyword is not a valid chroma value, is not present on the X11 color list but it is a valid keyword in CSS at least https://www.w3.org/TR/css-color-3/#transparent What is the reason behind that missing keyword?

markov00 avatar Sep 10 '21 16:09 markov00

as you said transparent is a keyword not a color-name. The doc sais "it will recognize any named color from the W3CX11 specification".

meodai avatar Sep 13 '21 14:09 meodai

as you said transparent is a keyword not a color-name

You are right, I was probably confused by the fact that W3C calls them keywords and not color names: Basic color keywords, Extended color keywords, A <color> is either a keyword (see Recognized color keyword names) or a numerical RGB specification.

I took a look at the X11 color list but seems that the chroma.js use the SVG color list instead, that is derived from that X11 color list but doesn't follow it completely: https://www.w3.org/TR/SVG11/types.html#ColorKeywords (the grey value is an example)

Anyway, what do you think about adding the transparent CSS color keyword into the list of the accepted color names? Do you think is reasonable, for a javascript color library, handling such exception?

markov00 avatar Sep 20 '21 09:09 markov00

Same issue for unset and any keyword... It's quite restrictive to not have those (I'm coming here from another addon that uses chroma as util).

frykten avatar Dec 30 '21 15:12 frykten