Skip to content

Conversation

@majiayu000
Copy link

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

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.

This fix configures a color palette with high-contrast colors
that provide good visibility in both light and dark themes,
improving accessibility and user experience.

Fixes go-gitea#36255

Signed-off-by: majiayu000 <[email protected]>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 30, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image captcha results in low contrast challenge in dark mode

2 participants