Use GUI hex colors in themes for true color support - #243
Conversation
Update all theme palettes to use the original Vim/Neovim GUI hex values (guifg/guibg) instead of 256-color approximations. This gives accurate colors on direct color terminals (TERM=xterm-direct) while the Color module still finds the closest 256-color match on other terminals. Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Updates bundled Textbringer themes to use upstream GUI hex palette values (guifg/guibg) so colors render accurately on true-color terminals while still mapping to nearest 256-color values when needed.
Changes:
- Replaced 256-color-derived hex approximations with upstream GUI hex palette values across multiple themes.
- Tweaked a few face definitions to better match upstream styling (e.g., bold function names, updated popup selection colors).
- Updated the theme-porting skill doc to standardize on GUI hex as the source of truth.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/textbringer/themes/tokyonight.rb | Adjusts palette commentary and updates one derived GUI hex value. |
| lib/textbringer/themes/sonokai.rb | Replaces palette colors with upstream GUI hex and adjusts isearch/popup selection styling. |
| lib/textbringer/themes/molokai.rb | Switches from cterm-derived colors to GUI hex values and refines punctuation coloring. |
| lib/textbringer/themes/gruvbox.rb | Updates dark/light palettes to GUI hex and makes function names bold. |
| lib/textbringer/themes/github.rb | Updates light palette GUI hex values and clarifies type color note. |
| lib/textbringer/themes/catppuccin.rb | Updates both Mocha/Latte palettes to official GUI hex definitions. |
| .claude/skills/port-theme/SKILL.md | Updates guidance to always use GUI hex values and revises the recommended theme template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| t.face :control | ||
| t.face :region, background: :bg4 | ||
| t.face :isearch, foreground: :bg0, background: :green | ||
| t.face :isearch, foreground: :bg0, background: :green, reverse: true |
There was a problem hiding this comment.
reverse: true inverts the color pair (via Curses::A_REVERSE), so with foreground: :bg0, background: :green this will render as green text on bg0 rather than bg0 text on a green highlight. Either drop reverse: true here, or swap the foreground/background values (as done in gruvbox.rb) to keep the intended highlight colors when reversed.
| t.face :isearch, foreground: :bg0, background: :green, reverse: true | |
| t.face :isearch, foreground: :green, background: :bg0, reverse: true |
|
|
||
| Convert xterm-256 color numbers to hex: | ||
| **Vim themes:** | ||
| Use the `guifg`/`guibg` hex values (e.g. `#F92672`), NOT `ctermfg`/`ctermbg` numbers. If a Vim theme only provides cterm values without GUI values, convert them to hex using the xterm-256 color table: |
There was a problem hiding this comment.
This section uses an uppercase hex example (#F92672) but later the guide states that hex values must be lowercase. Consider changing the example to lowercase to match the documented convention and avoid confusion.
| Use the `guifg`/`guibg` hex values (e.g. `#F92672`), NOT `ctermfg`/`ctermbg` numbers. If a Vim theme only provides cterm values without GUI values, convert them to hex using the xterm-256 color table: | |
| Use the `guifg`/`guibg` hex values (e.g. `#f92672`), NOT `ctermfg`/`ctermbg` numbers. If a Vim theme only provides cterm values without GUI values, convert them to hex using the xterm-256 color table: |
- Swap foreground/background in sonokai isearch so reverse renders correctly - Use lowercase hex in port-theme skill example to match documented convention Co-Authored-By: Claude Opus 4.6 <[email protected]>
Update all theme palettes to use the original Vim/Neovim GUI hex values (guifg/guibg) instead of 256-color approximations. This gives accurate colors on direct color terminals (TERM=xterm-direct) while the Color module still finds the closest 256-color match on other terminals.