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

Take Alpha into account when doing Color Blending #6

Closed
Pixaurora opened this issue Mar 30, 2024 · 2 comments
Closed

Take Alpha into account when doing Color Blending #6

Pixaurora opened this issue Mar 30, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@Pixaurora
Copy link

Pixaurora commented Mar 30, 2024

Is your feature request related to a problem? Please describe.
When using any of the blend modes, alpha is ignored and set to 1.0 when the color is returned.

Describe the solution you'd like
It would be nice to be able to have the blend modes apply "less intensely" if the opacity of the source color is lower, i.e. when using Normal, if the source's opacity is 0, the backdrop's color would be unchanged.

After dwelling on this for a bit, I think an acceptable solution could be to use Color::mix_with on the source color, mixing with the backdrop color with the weight being based on the differences between their alpha channels (i.e. source alpha - backdrop alpha). I'm open to different ideas though!

@JiatLn JiatLn added the good first issue Good for newcomers label Mar 31, 2024
@JiatLn
Copy link
Owner

JiatLn commented Mar 31, 2024

thank you for your issue! I fixed it in v0.3.8

@JiatLn JiatLn closed this as completed Mar 31, 2024
@Pixaurora
Copy link
Author

Thank you!

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

No branches or pull requests

2 participants