Skip to content

feat(ansi): add x11 color names for osc 10-12#414

Open
mkotowski wants to merge 1 commit intocharmbracelet:mainfrom
mkotowski:feat/set-foreground-named-color
Open

feat(ansi): add x11 color names for osc 10-12#414
mkotowski wants to merge 1 commit intocharmbracelet:mainfrom
mkotowski:feat/set-foreground-named-color

Conversation

@mkotowski
Copy link
Copy Markdown
Contributor

As per xterm's ctlseqs OSC 10-19 colors:

[...] are specified by name or RGB specification as per XParseColor

This commit extends x/ansi XParseColor implementation to also support the X11 color names.

Optionally, vt's handleDefaultColor can also be extended to ignore strings longer than the max length of the passed string (65535u to match xterm's behavior with MAX_U_STRING const).

As per xterm's ctlseqs OSC 10-19 colors:

> [...] are specified by name or RGB specification as per XParseColor

This commit extends x/ansi XParseColor implementation to also
support the X11 color names.

Signed-off-by: Michał Kotowski <dev@mkotowski.dev>
@mkotowski mkotowski requested a review from aymanbagabas as a code owner March 27, 2025 05:39
@aymanbagabas
Copy link
Copy Markdown
Contributor

aymanbagabas commented Apr 20, 2025

Thank you, @mkotowski, for sending this PR. Why don't you simply use x/image/colornames instead?

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.

2 participants