- From: Isaac Muse via GitHub <noreply@w3.org>
- Date: Wed, 07 Jan 2026 14:13:38 +0000
- To: public-css-archive@w3.org
I just want to explain a little why blend modes don't work always. The examples may demonstrate differences, but don't necessarily explain why some of the differences are odd. 1. Blend modes, as they are currently defined, assume a space whose channels are 0 - 1 by default, where 0 is assumed to be no response and 1 to be the maximum. There is also an assumption that 1 means brighter for some blend modes; this would not be the case for something like CMY. 2. Lab-like spaces have channels whose ranges do not conform to this 0 - 1 expectation, and even go from 0 to a positive or negative maximum. Some blend modes, like `normal`, work because they don't expose any of these issues. `normal` just returns the source value, so none of the expected context comes into play. `multiply` gets weird because now you are multiplying source and destination, but it now behaves differently, as you may have a large negative channel and a large positive channel. In RGB spaces, valid values are assumed to be all positive. Results get weird when this is not the case. `darken` often wants to take the minimum of the source and destination. This gets confusing as Lab-like spaces now have positive and negative maximums for the a and b channel. `color-dodge` will often return the max and minimum in some cases as 1 or 0, or do more complex logic where values are subtracted from the assumed max of 1. But obviously, the assumption that the channels have minimums and maximums of 0 and 1 is a fallacy when evaluating Lab-like spaces. This is why I mean the blend modes are designed for RGB spaces, or at least spaces that have the same expectations as RGB. Porter-Duff operators work because you are just altering how the alpha channel affects the overlaying, and alpha logic is consistent across all spaces. Hopefully that makes sense. -- GitHub Notification of comment by facelessuser Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13254#issuecomment-3719078095 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 7 January 2026 14:13:39 UTC