gitea/services/context
lif 4ed43c2a32
fix: Improve image captcha contrast for dark mode (#36265)
## Summary
This PR fixes #36255

The image captcha was using random colors which often resulted in poor
contrast against dark backgrounds, making it difficult or impossible for
users to read in dark mode.

## Changes
- Added a custom color palette to the image captcha configuration in
`services/context/captcha.go`
- The palette uses high-contrast colors (bright red, blue, green,
yellow, purple, and dark blue-gray) that provide good visibility in both
light and dark themes
- This improves accessibility and user experience without changing any
existing functionality

## Testing
- Builds successfully
- All existing tests pass
- The color palette is properly supported by the upstream
`gitea.com/go-chi/captcha` library

---
Generated with Claude Code

---------

Signed-off-by: majiayu000 <1835304752@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-01-24 05:41:51 +00:00
..
upload Edit file workflow for creating a fork and proposing changes (#34240) 2025-06-22 12:43:43 +00:00
access_log.go Address some CodeQL security concerns (#35572) 2025-10-04 01:21:26 +08:00
access_log_test.go Address some CodeQL security concerns (#35572) 2025-10-04 01:21:26 +08:00
api.go Replace CSRF cookie with `CrossOriginProtection` (#36183) 2025-12-25 12:33:34 +02:00
api_org.go
api_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
base.go Fix link/origin referrer and login redirect (#36279) 2026-01-03 11:43:04 +08:00
base_form.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +08:00
base_path.go Address some CodeQL security concerns (#35572) 2025-10-04 01:21:26 +08:00
base_test.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
captcha.go fix: Improve image captcha contrast for dark mode (#36265) 2026-01-24 05:41:51 +00:00
context.go Refactor template render (#36438) 2026-01-24 05:11:49 +00:00
context_cookie.go Replace CSRF cookie with `CrossOriginProtection` (#36183) 2025-12-25 12:33:34 +02:00
context_model.go Refactor context repository (#33202) 2025-01-12 03:39:46 +00:00
context_request.go
context_response.go Check user visibility when redirecting to a renamed user (#36148) 2025-12-14 03:14:18 +01:00
context_template.go Support selecting theme on the footer (#35741) 2025-10-28 18:25:00 +08:00
context_test.go Refactor request context (#32956) 2024-12-24 11:43:57 +08:00
org.go Fix OrgAssignment opts (#36174) 2025-12-17 17:19:22 +08:00
package.go Refactor template render (#36438) 2026-01-24 05:11:49 +00:00
pagination.go Fix notifications pagination query parameters (#36351) 2026-01-12 22:17:42 +00:00
pagination_test.go Fix notifications pagination query parameters (#36351) 2026-01-12 22:17:42 +00:00
permission.go Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +00:00
private.go Fix SSH LFS timeout (#34838) 2025-06-24 15:49:31 +00:00
repo.go Use gitRepo as parameter instead of repopath when invoking sign functions (#36162) 2025-12-17 21:55:08 +00:00
response.go Remove duplicate "ResponseWriter.Status" method (#33346) 2025-01-22 06:37:52 +00:00
user.go Check user visibility when redirecting to a renamed user (#36148) 2025-12-14 03:14:18 +01:00
utils.go