-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix and rewrite contrast color calculation, fix project-related bugs #30237
Conversation
I'm not exactly sure how the current formula is called but if we eventually switch it to the APCA formula it'll be good to distinguish that the passed-in color is a background color, because that formula is not symmetric:
|
Ready again. I took the opportunity to fix two more related bugs in projects:
|
I was unable to create a backport for 1.22. @silverwind, please send one manually. 🍵
|
* giteaofficial/main: (26 commits) Fix oauth2 builtin application logic (go-gitea#30304) [skip ci] Updated licenses and gitignores Some NuGet package enhancements (go-gitea#30280) Fix and rewrite contrast color calculation, fix project-related bugs (go-gitea#30237) Add `--page-spacing` variable, fix admin dashboard notice (go-gitea#30302) Action view mobile improvements and fixes (go-gitea#30309) Fix checkboxes on mobile view, remove some dead css (go-gitea#30308) Clean up log messages (go-gitea#30313) Fix right-aligned input icons (go-gitea#30301) Refactor startup deprecation messages (go-gitea#30305) [skip ci] Updated translations via Crowdin Remove fomantic list module (go-gitea#30281) Markup color and font size fixes (go-gitea#30282) Fix code block style for code preview (go-gitea#30298) Always use `octicon-eye` on watch button (go-gitea#30288) Fix view commit link (go-gitea#30297) Add gap to commit status details (go-gitea#30284) Update JS dependencies and add new eslint rules (go-gitea#30279) Upgrade `golang.org/x/net` to v0.24.0 (go-gitea#30283) Commit-Dropdown: Show Author of commit if available (go-gitea#30272) ... # Conflicts: # templates/base/footer_content.tmpl
…o-gitea#30237) 1. The previous color contrast calculation function was incorrect at least for the `#84b6eb` where it output low-contrast white instead of black. I've rewritten these functions now to accept hex colors and to match GitHub's calculation and to output pure white/black for maximum contrast. Before and after: <img width="94" alt="Screenshot 2024-04-02 at 01 53 46" src="https://github.com/go-gitea/gitea/assets/115237/00b39e15-a377-4458-95cf-ceec74b78228"><img width="90" alt="Screenshot 2024-04-02 at 01 51 30" src="https://github.com/go-gitea/gitea/assets/115237/1677067a-8d8f-47eb-82c0-76330deeb775"> 2. Fix project-related issues: - Expose the new `ContrastColor` function as template helper and use it for project cards, replacing the previous JS solution which eliminates a flash of wrong color on page load. - Fix a bug where if editing a project title, the counter would get lost. - Move `rgbToHex` function to color utils. @HesterG fyi --------- Co-authored-by: delvh <[email protected]> Co-authored-by: Giteabot <[email protected]>
…30326) Backport #30237 to 1.22. Also includes #30183. Both were clean cherry-picks. Co-authored-by: Giteabot <[email protected]>
The previous color contrast calculation function was incorrect at least for the
#84b6eb
where it output low-contrast white instead of black. I've rewritten these functions now to accept hex colors and to match GitHub's calculation and to output pure white/black for maximum contrast. Before and after:Fix project-related issues:
ContrastColor
function as template helper and use it for project cards, replacing the previous JS solution which eliminates a flash of wrong color on page load.rgbToHex
function to color utils.@HesterG fyi