0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-02-02 11:49:44 -05:00
forgejo/modules
silverwind 9934931f1f
[PORT] gitea##30237: Fix and rewrite contrast color calculation, fix project-related bugs
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.

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>

---
Conflict resolution: Trivial.
(cherry picked from commit 36887ed3921d03f1864360c95bd2ecf853bfbe72)
(cherry picked from commit f6c0c39f1a)
2024-05-14 15:50:47 +02:00
..
actions
activitypub
analyze
assetfs
auth
avatar
base
cache
charset s/Gitea/Forgejo in various log messages and comments 2024-04-22 14:41:17 +00:00
container
csv
emoji
eventsource
generate
git Make "sync branch" also sync object format and add tests (#30878) (#30880) 2024-05-14 15:28:38 +02:00
gitgraph models/asymkey: Implement Tag verification 2024-04-01 13:42:11 +00:00
gitrepo
graceful [FIX] make pprof labels conformant with prometheus spec 2024-04-01 18:22:11 +00:00
hcaptcha
highlight
hostmatcher
html
httpcache
httplib Skip gzip for some well-known compressed file types (#30796) 2024-05-07 07:59:45 +01:00
indexer [FIX] Set max fuzziness to 2 for bleve (#3444) 2024-04-26 08:29:21 +00:00
issue/template
json
label
lfs Close file in the Upload func (#30262) (#30270) 2024-04-08 11:50:17 +02:00
log
markup Fix user mention processing 2024-04-30 12:28:49 +00:00
mcaptcha
metrics
migration
nosql s/Gitea/Forgejo in various log messages and comments 2024-04-22 14:41:17 +00:00
optional
options
packages Some NuGet package enhancements 2024-04-16 06:54:35 +00:00
paginator
pprof
private Move database operations of merging a pull request to post receive hook and add a transaction (#30805) 2024-05-14 15:37:32 +02:00
process [FIX] make pprof labels conformant with prometheus spec 2024-04-01 18:22:11 +00:00
proxy
proxyprotocol
public
queue
recaptcha
references
regexplru
repository Move database operations of merging a pull request to post receive hook and add a transaction (#30805) 2024-05-14 15:37:32 +02:00
secret
session Avoid importing modules/web/middleware in modules/session (#30584) (#30589) 2024-04-21 18:16:09 +02:00
setting s/Gitea/Forgejo in various log messages and comments 2024-04-22 14:41:17 +00:00
sitemap
ssh
storage
structs Fix no edit history after editing issue's title and content (#30814) 2024-05-07 08:21:38 +01:00
svg
sync
system
templates [PORT] gitea##30237: Fix and rewrite contrast color calculation, fix project-related bugs 2024-05-14 15:50:47 +02:00
test
testlogger Merge pull request '[v7.0/forgejo] [FEAT] Mark database errors in tests as failure' (#2978) from bp-v7.0/forgejo-2dabd20 into v7.0/forgejo 2024-04-02 15:53:23 +00:00
timeutil
translation Rename ByteSize to ReadableSize 2024-04-02 17:29:32 +00:00
turnstile
typesniffer
updatechecker
uri
user
util [PORT] gitea##30237: Fix and rewrite contrast color calculation, fix project-related bugs 2024-05-14 15:50:47 +02:00
validation
web Avoid importing modules/web/middleware in modules/session (#30584) (#30589) 2024-04-21 18:16:09 +02:00
webhook [FEAT] sourcehut webhooks 2024-04-05 19:36:04 +00:00