-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
CSS Color 4 RGB/RGBA syntax - Whitespace syntax and RGB alpha value #147
Comments
While I see where space syntax is specified in the level 4 syntax, I do not see it mentioned for functions like rgba and hsla, just for rgb, hsl, hwb, etc. |
Spec reference https://www.w3.org/TR/css-color-4/ |
I will have to verify real world browser usage of whitespace syntax for rgba as the spec isn't explicitly clear on this point. |
Okay, it seems as if browsers treat It seems commas cannot be mixed with whitespace and |
Yes As of CSS Colors Level 4, rgba() is an alias for rgb(). In browsers that implement the Level 4 standard, they accept the same parameters and behave the same way.
Yes
Yes [/ alpha] is for whitespace syntax. Alpha is supported in both formats
Numbers or percentages are allowed but can't be mixed for R, G & B. It's the same for hsl, I suggest to drop hsla and rgba in the conversion options list if "allowed_colors" is css4 |
That is a possibility. We'll have to see, if nothing, it is definitely a direction to work towards. |
Will probably make CSS Level 4 color behavior default and just drop old previous behavior. Browsers do this now as well, and I'm fine with that. With that said, it doesn't mean I'll have Lab support and things yet, just that RGB, HSL, and HWB will behave according to CSS Level 4. I don't know when I'll get to adding support for other color spaces 🙂. |
No browsers support them, but I probably won't take away comma format of I may disable This all will be handled by separate issues, just thought I'd mention it. |
I know I still haven't pushed out a release in like a month, but just an FYI, there should hopefully be a beta out sometime soon-ish (hoping within the week). There were many areas that were re-written and such. The aim was to allow more flexible input and output, more configurability, and improve color scanning behavior. Currently, all this work is on the Because of this, we've reworked color previews as now we have to handle colors that are out of gamut, so some simple gamut mapping is now available or the option to not show the color at all. We've added some new color tools as well. Anyways, a lot of work went into this next release which is why the holdup. |
Please read and fill out this template by replacing the instructions with appropriate information. If the template is not followed, the issue will be marked
Invalid
and closed.Before submitting an issue search past issues and read the area of the documentation related to your specific question, issue, or request.
Description
... what is the issue / request ?
Add support for CSS Color 4 RGB/RGBA syntax
Suggestion to support
/* Functional syntax with alpha value */
rgb(255, 0, 153, 1)
rgb(255, 0, 153, 100%)
/* Whitespace syntax */
rgb(255 0 153 / 1)
rgb(255 0 153 / 100%)
/* Functional syntax */
rgba(51, 170, 51, 1)
rgba(51, 170, 51, 100%)
/* Whitespace syntax */
rgba(51 170 51 / 0.4)
rgba(51 170 51 / 40%)
😀 https://www.chromestatus.com/feature/5124205561511936
Support Info
...
Steps to Reproduce Issue
The text was updated successfully, but these errors were encountered: