-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support CSS Color Module Level 4 #47
Comments
Kudos to @ax-sc! The level 3 test suite passes with the Note that CMYK support has been postponed to level 5 (it was already postponed from level 3 to 4). |
Well, it doesn’t. Thanks to isort I’ve found that imports were broken. But news are still really good: the tests failing are the ones that are supposed to give different results with Level 3 and Level 4. I’ll open a PR to split 3 and 4 in the testing suite. (Edit: CourtBouillon/css-parsing-tests#10.) |
Thanks for moving this forward, @liZe. I added some test cases for the parts of the specification introduced with #48 in CourtBouillon/css-parsing-tests#11. If you want, i can have a look at the missing |
Amazing, thanks a lot!
It will be probably more difficult to test, because these functions don’t directly return sRGB colors. I have to read the specification again and again to understand how "device-independent colors" work and thus how they can be tested. If you know anything about gamuts and color spaces, don’t hesitate to share your hints! It could be easier to understand than Wikipedia’s very informative but quite dense pages. |
Yes, that´s the reason why i did not implement them in the first step.
Although i know some things about color spaces etc., i would definitely need to look at the specification myself again as well. I will keep you updated and try to summarise the most important information once i have done this. |
I’ve added some code to handle the missing |
Handling the As we sometimes convert the original value into "normalized" value (for example Leading to this question: is the new standard A solution would be to keep this class to store the computed value, but add the original function in other fields. This way, we could keep the current "simple" computed fields while keeping the original fields (possibly containing |
Sorry to interrupt, do you think it is safe to pip install this branch? I need hsl support. |
As explained in Kozea/CairoSVG#379, hsl is already supported in Level 3. |
(Current code is in the
color4
branch.)The primary change, compared to CSS Color 3, is that CSS colors are no longer restricted to the narrow gamut of sRGB.
To support this, several brand new features have been added:
color()
functionOther technical changes:
<color>
is now specified here, rather than in the CSS Object ModelIn addition, there have been some syntactic changes:
<number>
rather than<integer>
.<angle>
as well as<number>
for hues.<alpha-value>
now accept<percentage>
as well as<number>
.The text was updated successfully, but these errors were encountered: