-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Compute proper foreground color for labels #16729
Conversation
6221115
to
2456418
Compare
This comment has been minimized.
This comment has been minimized.
Note there is a similar function in JS that should be made to match the backend implementation: gitea/web_src/js/components/ContextPopup.vue Lines 75 to 86 in c9bca8c
|
Good catch! I'll fix that this evening |
Fixed! |
I think this all looks great, would you be able to attach a couple example images? |
Sure thing! I'll take some tonight with some sample colours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disregard my other comment, for some reason I thought this was changing colors, rather it's just a different formula for choosing white/black text.
I'll still take some tonight anyway, since it might be helpful for the changelog |
This properly ensures that the contrast ratio is maximised for any given color choice.
The comments explain the exact calculations done (you can check that I transcribed it correctly), but to fully clarify for review: