Skip to content

fix: use true color for code_block rendering if support detected#891

Open
aslpavel wants to merge 1 commit intocharmbracelet:masterfrom
aslpavel:master
Open

fix: use true color for code_block rendering if support detected#891
aslpavel wants to merge 1 commit intocharmbracelet:masterfrom
aslpavel:master

Conversation

@aslpavel
Copy link
Copy Markdown

There is a bug in how code_block is rendered, currently 256 colors palette is used regardless whether true color is detected or not. To reproduce just render any markdown document which contains ```language... colors will be off because they are quantized to nearest color from 256 palette.

Here is example is before (top) and after (bottom)
image

This change correctly initializes true color in Chroma library

@aslpavel aslpavel requested a review from a team as a code owner February 27, 2026 17:27
@aslpavel aslpavel requested review from meowgorithm and raphamorim and removed request for a team February 27, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant