[PR #9016] feat(tui): highlight hex codes with the color #12950

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

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

State: closed
Merged: No


What does this PR do?

Highlights hex color codes in markdown content with their actual color as the background. The foreground text automatically switches between black and white based on luminance for readability.
Supports:

  • 3-char (#rgb)
  • 4-char (#rgba)
  • 6-char (#rrggbb)
  • 8-char with alpha (#rrggbbaa)
    Colors with alpha are blended against the theme background, and update correctly when switching themes.

Closes #2586

How did you verify your code works?

Manual verification in Wezterm and Powershell on Windows

https://github.com/user-attachments/assets/dfc4aac9-1d11-492c-bfe8-ddb8776ee3e9

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9016 **State:** closed **Merged:** No --- ### What does this PR do? Highlights hex color codes in markdown content with their actual color as the background. The foreground text automatically switches between black and white based on luminance for readability. Supports: - 3-char (#rgb) - 4-char (#rgba) - 6-char (#rrggbb) - 8-char with alpha (#rrggbbaa) Colors with alpha are blended against the theme background, and update correctly when switching themes. Closes #2586 ### How did you verify your code works? Manual verification in Wezterm and Powershell on Windows https://github.com/user-attachments/assets/dfc4aac9-1d11-492c-bfe8-ddb8776ee3e9
yindo added the pull-request label 2026-02-16 18:17:50 -05:00
yindo closed this issue 2026-02-16 18:17:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12950