# terminal: Fix 8 bit colors \(\#54565\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/77cfc5dd381fc16b2bbda7d70a2602f72c633f37)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 77cfc5dd381fc16b2bbda7d70a2602f72c633f37

Requested commit: 77cfc5dd381fc16b2bbda7d70a2602f72c633f37

Commit: 77cfc5dd381fc16b2bbda7d70a2602f72c633f37

Tree: 8703e4d7d2f628c9cea9b2bc85e618d875dda043

Author: Finn Eitreim

Committer: GitHub

## Message

```
terminal: Fix 8 bit colors (#54565)

Right now the terminal rendering code applies a minimum contrast value
(which is good, and for accessibility) to colors that appear, there was
already an exemption from this for 24bit color specification, because
the application explicitly asked for that color, so it should be
rendered that color.

My change changes that exemption to also include ansi colors 16-255,
because these are also set explicitly, the normal, non-exempt case is
now the default ansi colors, 0-15, these are set by the theme and are
usually specified as just 'red' or 'green', hence the importance of the
min contrast.

Heres what the gradient ramp from the original issue looks like now:

<img width="944" height="1123" alt="Screenshot 2026-04-22 at 6 45 43 PM"
src="https://github.com/user-attachments/assets/918d62db-ed8e-475c-9ec1-c60187ad4b5e"
/>

This matches ghostty and VSCodium from the original issue.

test prevents regressions but idk, maybe not nessecary.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #54396 

Release Notes:

- terminal: Improved 256 color ansi rendering
```

## Parents

- [4acb9d4ac6aec5ea3d033f554d38c9d8199345e8](https://git.cafe/gitcafe/zed/commit/4acb9d4ac6aec5ea3d033f554d38c9d8199345e8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/77cfc5dd381fc16b2bbda7d70a2602f72c633f37?format=markdown)
