mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-24 20:45:56 +03:00
[PR #713] feat(core): derive missing ANSI 256 palette entries from base16 #1511
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1511
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/713
Author: @kavhnr
Created: 2/19/2026
Status: 🔄 Open
Base:
main← Head:feat/ansi256-derived-palette📝 Commits (2)
a075cd5feat(core): derive missing ansi256 palette entries from base1600decccrefactor(core): tighten ansi256 derivation defaults and API surface📊 Changes
4 files changed (+324 additions, -4 deletions)
View changed files
➕
packages/core/src/lib/palette-256.test.ts(+43 -0)➕
packages/core/src/lib/palette-256.ts(+173 -0)📝
packages/core/src/lib/terminal-palette.test.ts(+88 -0)📝
packages/core/src/lib/terminal-palette.ts(+20 -4)📄 Description
Summary
TerminalPalette, aligned with Ghostty's approach.16-255whensize >= 256and base16 + fg/bg are available, while preserving any explicit palette entries already returned by the terminal.Context
This follows the Ghostty work and reference implementation notes:
Behavior
GetPaletteOptions.generateFromBase16option (default:true).size >= 2560-15are present7/0).16-255are never overwritten.Validation
bun test src/lib/palette-256.test.ts src/lib/terminal-palette.test.ts🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.