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

[css-color-5] color-mix() could benefit from additional examples to understand the behavior of mixing colors with alpha #6833

Closed
weinig opened this issue Nov 27, 2021 · 4 comments

Comments

@weinig
Copy link
Contributor

weinig commented Nov 27, 2021

I would have (and I guess still would) found it helpful when implementing color-mix() if the spec, https://drafts.csswg.org/css-color-5/#color-mix, included examples of mixing colors with non-opaque alpha. This would help to clarify things like alpha premultiplication behavior and how that interacts with the additional alpha multiplication that happens when the sum of the percentages does not add up to 100.

@svgeesus
Copy link
Contributor

I added a basic, in srgb alpha mix example. Will add more.

@svgeesus
Copy link
Contributor

svgeesus commented Dec 2, 2021

I added a second example with an alpha multiplier, and a note not to combine the interpolated alpha with the alpha multiplier before undoing premultiplication.

@svgeesus
Copy link
Contributor

svgeesus commented Dec 2, 2021

@weinig does that address your concern or would you like more examples?

@weinig
Copy link
Contributor Author

weinig commented Dec 2, 2021

This looks great. Thanks.

(You do have a typo though, "When the percentage ormalization gnerates an alpha multiplier").

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

No branches or pull requests

2 participants