Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transparent keyword missing #280

Closed
markov00 opened this issue Sep 10, 2021 · 4 comments · May be fixed by WontonSam/style-dictionary#218 or WontonSam/style-dictionary#247
Closed

transparent keyword missing #280

markov00 opened this issue Sep 10, 2021 · 4 comments · May be fixed by WontonSam/style-dictionary#218 or WontonSam/style-dictionary#247
Labels
Milestone

Comments

@markov00
Copy link

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?

@meodai
Copy link

meodai commented Sep 13, 2021

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

@markov00
Copy link
Author

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?

@frykten
Copy link

frykten commented Dec 30, 2021

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).

@gka
Copy link
Owner

gka commented Aug 18, 2024

Late reply, but is the idea to make chroma.valid('transparent') return true?

I'm be inclined to add transparent as special color to the css2rgb method, but not sure about other CSS keywords such as unset, inherit etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants