Re: [fxtf-drafts] [css-compositing-2] Remove plus-darker (#447)

I wrote a test in https://github.com/web-platform-tests/wpt/pull/41713 that tests the composite modes in canvas.  It turns out my test objected to the formula in https://github.com/w3c/fxtf-drafts/issues/447#issuecomment-1489513453 because it wasn't producing properly premultiplied colors:  there were cases where the color result was greater than the alpha result, which isn't allowed.

However, my formula was sort of close; it appears (based on fiddling with my test) that what Safari implements for `plus-darker` is:

co = min(1, αs + αb) - min(1, αs x (1 - Cs) + αb x (1 - Cb));
αo = min(1, αs + αb);

(It's possible there's a simpler way to write this, but that's the expression I figured out that leads to Safari passing the test for `plus-darker`.)

-- 
GitHub Notification of comment by dbaron
Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/447#issuecomment-1699293766 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 30 August 2023 14:27:56 UTC