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

Better transparency handling with math ops and blending functions? #1675

Closed
seven-phases-max opened this issue Nov 23, 2013 · 1 comment
Closed

Comments

@seven-phases-max
Copy link
Member

I was playing with #1673 issue, specifically thinking of more reasonable alpha calculation and found that things go a bit wider than just a proper alpha op. Beside math ops, there are also color blending functions that totally ignore alpha channels and always return non-transparent colors (so blending functions don't suffer from #1673 :).
E.g.:

color: average(rgba(255, 0, 0, .5), rgba(0, 0, 255, .5)); // -> #800080

Probably a transparency handling similar to http://www.w3.org/TR/compositing-1/#blending would make more sense. And it looks like this should somehow apply to math ops as well.

Additionally it seems that ideally tree.Color op tree.Dimension and tree.Color op tree.Color where op is * or / operations should be handled in different ways, e.g.:

mul {
    a: (#800000 * 2);       // -> #ff0000, OK
    b: (#100000 * #100000); // -> #ff0000, i.e. ~black * ~black = red :)
                            // could it be blending `multiply` instead?
}

Of course all this will need a lot of code changes so that "demand/efforts ratio" becomes questionable, but I just wanted to have some food for thought.

@seven-phases-max
Copy link
Member Author

So transparency for blending functions is implemented with #1704. And as for transparency of math ops I guess I abandon/postpone this idea since it does not seems like possible use-cases are worth an efforts needed and an additional complier burden (Though the research for possible algorithms was quite inspirational on its own :)

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

1 participant