Open waywardmonkeys opened 3 hours ago
Those are the reasons I didn't add it. My feeling is we don't add the methods unless there's specific call for them.
The motivation for it in DynamicColor is to support CSS Color 5 contrast-color adequate contrast logic. Of course, if you think about it, the idea is pretty broken when alpha is involved, so it might end up being one of those poorly thought through things the web is full of.
Not having it in the static color alpha types may encourage people to resolve to opaque color, which is sensible.
There was also discussion of WCAG 3 using a different algorithm, like APCA: https://github.com/Myndex/SAPC-APCA
But that looks like it went dormant (in the W3 Silver Wiki).
I noticed that we don't have
relative_luminance
forAlphaColor
and I assume that's because this formulation isn't as useful when there's alpha involved. But forDynamicColor
, we just discard the alpha. But we also don't have this function forPremulColor
...Should we have it for
AlphaColor
and discarding the Alpha?Should we have it for
PremulColor
?I don't have good arguments in favor of having it, so I'm just asking so we can have a decision.