aboutsummaryrefslogtreecommitdiffstats
path: root/modules/templates/helper.go
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-04-09 11:45:29 +0200
committerGitHub <noreply@github.com>2024-04-09 09:45:29 +0000
commitb8e9d3c55392245543f03d6d92d50c605786789f (patch)
treedc3a8b52629793ff31dd9f63a0d19e0fc07e4ea5 /modules/templates/helper.go
parent82992cf32dbbdf974cc45db996f74246baa961a5 (diff)
downloadgitea-b8e9d3c55392245543f03d6d92d50c605786789f.tar.gz
gitea-b8e9d3c55392245543f03d6d92d50c605786789f.zip
Fix and rewrite contrast color calculation, fix project-related bugs (#30326)
Backport https://github.com/go-gitea/gitea/pull/30237 to 1.22. Also includes https://github.com/go-gitea/gitea/pull/30183. Both were clean cherry-picks. Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'modules/templates/helper.go')
-rw-r--r--modules/templates/helper.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index 2452064749..e69adbd705 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -53,13 +53,13 @@ func NewFuncMap() template.FuncMap {
"JsonUtils": NewJsonUtils,
// -----------------------------------------------------------------
- // svg / avatar / icon
+ // svg / avatar / icon / color
"svg": svg.RenderHTML,
"EntryIcon": base.EntryIcon,
"MigrationIcon": MigrationIcon,
"ActionIcon": ActionIcon,
-
- "SortArrow": SortArrow,
+ "SortArrow": SortArrow,
+ "ContrastColor": util.ContrastColor,
// -----------------------------------------------------------------
// time / number / format