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

Relative luminance for AlphaColor and PremulColor #49

Open
waywardmonkeys opened this issue Nov 17, 2024 · 2 comments
Open

Relative luminance for AlphaColor and PremulColor #49

waywardmonkeys opened this issue Nov 17, 2024 · 2 comments

Comments

@waywardmonkeys
Copy link
Collaborator

I noticed that we don't have relative_luminance for AlphaColor and I assume that's because this formulation isn't as useful when there's alpha involved. But for DynamicColor, we just discard the alpha. But we also don't have this function for PremulColor ...

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.

@raphlinus
Copy link
Contributor

raphlinus commented Nov 17, 2024

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.

@waywardmonkeys
Copy link
Collaborator Author

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).

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

No branches or pull requests

2 participants