Skip to content

terminal_element: Skip contrast adjustment for 24-bit color#52162

Merged
Veykril merged 1 commit intozed-industries:mainfrom
nihalxkumar:fix/terminal-true-color-contrast
Apr 20, 2026
Merged

terminal_element: Skip contrast adjustment for 24-bit color#52162
Veykril merged 1 commit intozed-industries:mainfrom
nihalxkumar:fix/terminal-true-color-contrast

Conversation

@nihalxkumar
Copy link
Copy Markdown
Contributor

@nihalxkumar nihalxkumar commented Mar 23, 2026

Context

Red and blue have inherently low perceptual luminance in APCA — pure default Lc 45 threshold. This caused ensure_minimum_contrast to lighten them, washing out the color to pink/lavender.

When an application explicitly specifies an RGB value via ESC[38;2;R;G;Bm,
that color should be rendered as-is. Named and indexed colors continue to be contrast-adjusted since they come from theme mappings

zed-colors-before.webm
zed-colors-after.webm

Closes: #50396

Self-Review Checklist

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • Fixed true-color render in terminal

…ground

Red and blue have inherently low perceptual luminance in APCA — pure
default Lc 45 threshold. This caused ensure_minimum_contrast to lighten
them, washing out the color to pink/lavender.

When an application explicitly specifies an RGB value via
ESC[38;2;R;G;Bm,
that color should be rendered as-is. Named and indexed colors continue
to be contrast-adjusted since they come from theme mappings
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Mar 23, 2026
@zed-community-bot zed-community-bot Bot added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Mar 23, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator Bot requested review from a team, Veykril and cole-miller and removed request for a team March 23, 2026 06:06
Copy link
Copy Markdown
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril Veykril merged commit b22b149 into zed-industries:main Apr 20, 2026
43 checks passed
@Veykril Veykril assigned Veykril and unassigned cole-miller Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A red color is absent from all dark themes, only visible on light

4 participants