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

support CSS Color Level 4 #48

Merged
merged 1 commit into from
Sep 6, 2022
Merged

support CSS Color Level 4 #48

merged 1 commit into from
Sep 6, 2022

Conversation

ax-sc
Copy link
Contributor

@ax-sc ax-sc commented Jun 24, 2022

Hi, thank you for your work on tinycss2 and WeasyPrint. As i would be very happy to see CMYK support in the future i took a closer look at the different color specifications and their implementation in WeasyPrint.

Coming from Kozea/WeasyPrint#1630 and #47 i started to work on the support of the CSS Color Level 4 specification.

The implementation is currently limited to:

  • parse_color() accepts now space-seperated arguments with an optional slash-seperated opacity
  • added definition of rebeccapurple
  • percentages are accepted for all opacity arguments
  • added hwb() function
  • hsla()/rgba() are aliases to hsl()/rgb()

Adding more tests to cover the changes and the level 4 spec would require changes to SimonSapin/css-parsing-tests. I did not start to prepare them yet, but i can open another PR there if this is the way you would like to implement the tests.

I will take a look at some of the other changes listed here and try to implement them as well (e.g. syntactic changes 1 and 2) but i wanted to check-in early to get your feedback before spending more time on this. Let me know what you think and if i should revise some parts of the current implementation.

Implementation of level 4 specifications is currently limited to (1) space-seperated arguments with an optional slash-seperated opacity, (2) definition of 'rebeccapurple', (3) percentages and numbers are accepted as opacity value, (4) the hwb() function and (5) hsla()/rgba() being aliases to hsl()/rgb().
@liZe
Copy link
Member

liZe commented Sep 6, 2022

Thanks for the PR! Let’s work on this topic on a dedicate branch.

@liZe liZe changed the base branch from master to color4 September 6, 2022 11:59
@liZe liZe marked this pull request as ready for review September 6, 2022 11:59
@liZe liZe merged commit 5ce0ab5 into Kozea:color4 Sep 6, 2022
@liZe
Copy link
Member

liZe commented Sep 6, 2022

Well, CMYK has been postponed to color5. Maybe we should consider following color5 instead of color4.

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

Successfully merging this pull request may close these issues.

2 participants