gitea/modules
silverwind 36887ed392
Fix and rewrite contrast color calculation, fix project-related bugs (#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 <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-04-07 16:19:25 +07:00
..
actions Fix some pending problems (#29985) 2024-03-22 19:17:30 +07:00
activitypub
analyze
assetfs
auth Use `crypto/sha256` (#29386) 2024-02-25 13:32:13 +07:00
avatar Use `crypto/sha256` (#29386) 2024-02-25 13:32:13 +07:00
badge Implement actions badge svgs (#28102) 2024-02-27 18:56:18 +07:00
base Refactor StringsToInt64s (#29967) 2024-03-21 15:07:35 +07:00
cache Always enable caches (#28527) 2023-12-19 09:29:05 +07:00
charset Render embedded code preview by permlink in markdown (#30234) 2024-04-02 17:48:27 +07:00
container
csv Render embedded code preview by permlink in markdown (#30234) 2024-04-02 17:48:27 +07:00
dump Refactor "dump" sub-command (#30240) 2024-04-03 02:16:46 +07:00
emoji
eventsource
generate Refactor JWT secret generating & decoding code (#29172) 2024-02-16 15:18:30 +07:00
git Refactor commit signature parser (#30228) 2024-04-01 20:23:17 +07:00
gitgraph
gitrepo Move get/set default branch from git package to gitrepo package to hide repopath (#29126) 2024-03-08 15:30:10 +07:00
graceful Remove unused error in graceful manager (#29871) 2024-03-18 21:14:51 +07:00
hcaptcha
highlight Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +07:00
hostmatcher
html
httpcache Also match weakly validated ETags (#28957) 2024-01-29 16:18:40 +07:00
httplib Refactor external URL detection (#29973) 2024-03-22 04:32:40 +07:00
indexer Render embedded code preview by permlink in markdown (#30234) 2024-04-02 17:48:27 +07:00
issue/template Extend issue template yaml engine (#29274) 2024-03-04 01:37:00 +07:00
json
label
lfs fix: close file in the Upload func (#30262) 2024-04-03 10:58:13 +07:00
log
markup Fix code block style for code preview (#30298) 2024-04-06 20:07:08 +07:00
mcaptcha
metrics
migration Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +07:00
nosql
optional migrate some more "OptionalBool" to "Option[bool]" (#29479) 2024-02-29 18:52:49 +07:00
options
packages Integrate alpine `noarch` packages into other architectures index (#29137) 2024-02-25 15:10:55 +07:00
paginator
pprof
private Return `responseText` instead of string in some functions (#28836) 2024-01-19 10:45:23 +07:00
process
proxy
proxyprotocol
public Refactor CORS handler (#28587) 2023-12-25 20:13:18 +07:00
queue Fix queue worker incorrectly stopped when there are still more items in the queue (#29532) 2024-03-02 16:07:54 +07:00
recaptcha
references Fix issue link does not support quotes (#29484) (#29487) 2024-03-02 09:54:46 +07:00
regexplru
repository Add user blocking (#29028) 2024-03-04 08:16:03 +07:00
secret Use `crypto/sha256` (#29386) 2024-02-25 13:32:13 +07:00
session
setting Refactor startup deprecation messages (#30305) 2024-04-07 01:11:25 +07:00
sitemap
ssh
storage
structs Add API for `Variables` (#29520) 2024-03-28 20:40:35 +07:00
svg Refactor markdown attention render (#29984) 2024-03-22 12:16:23 +07:00
sync
system
templates Fix and rewrite contrast color calculation, fix project-related bugs (#30237) 2024-04-07 16:19:25 +07:00
test
testlogger
timeutil Refactor "dump" sub-command (#30240) 2024-04-03 02:16:46 +07:00
translation Render embedded code preview by permlink in markdown (#30234) 2024-04-02 17:48:27 +07:00
turnstile
typesniffer
updatechecker
uri
user
util Fix and rewrite contrast color calculation, fix project-related bugs (#30237) 2024-04-07 16:19:25 +07:00
validation
web Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +07:00
webhook Fix schedule tasks bugs (#28691) 2024-01-12 21:50:38 +07:00