[PR #4574] fix: ensure selected list items are readable with transparent background #11028

Closed
opened 2026-02-16 18:15:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/4574

State: closed
Merged: No


Fixes: https://github.com/sst/opencode/issues/4369

Summary

Fix unreadable text in selected list items when theme uses background: "none"

Details

When a theme sets "background": "none", the background color resolves to fully transparent. Previously, selected list items used theme.background as the foreground color, making the text invisible. This PR adds a helper that returns a contrasting color (black or white) based on the luminance of theme.

Before:

Screenshot 2025-11-21 at 16 33 19 Screenshot 2025-11-21 at 16 33 30

After:

Screenshot 2025-11-21 at 16 36 04 Screenshot 2025-11-21 at 16 36 11
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/4574 **State:** closed **Merged:** No --- Fixes: https://github.com/sst/opencode/issues/4369 ## Summary Fix unreadable text in selected list items when theme uses background: "none" ## Details When a theme sets "background": "none", the background color resolves to fully transparent. Previously, selected list items used theme.background as the foreground color, making the text invisible. This PR adds a helper that returns a contrasting color (black or white) based on the luminance of theme. ### Before: <img width="810" height="547" alt="Screenshot 2025-11-21 at 16 33 19" src="https://github.com/user-attachments/assets/77deede7-a0ca-4dc6-826e-036dd8c17eee" /> <img width="804" height="441" alt="Screenshot 2025-11-21 at 16 33 30" src="https://github.com/user-attachments/assets/0a0a2887-8b7d-4155-a617-38f48106523f" /> ### After: <img width="800" height="548" alt="Screenshot 2025-11-21 at 16 36 04" src="https://github.com/user-attachments/assets/364d3f7b-cca4-4a77-938f-705bedb900ae" /> <img width="836" height="472" alt="Screenshot 2025-11-21 at 16 36 11" src="https://github.com/user-attachments/assets/4cdd325e-1e43-4ad7-b7e6-ba54e045dc2a" />
yindo added the pull-request label 2026-02-16 18:15:48 -05:00
yindo closed this issue 2026-02-16 18:15:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11028