Skip to content

Expand xresources color support#2234

Open
bim9262 wants to merge 1 commit into
greshake:masterfrom
bim9262:xresources_rgb
Open

Expand xresources color support#2234
bim9262 wants to merge 1 commit into
greshake:masterfrom
bim9262:xresources_rgb

Conversation

@bim9262
Copy link
Copy Markdown
Collaborator

@bim9262 bim9262 commented Jan 24, 2026

As observed in #2230:

I found https://man.archlinux.org/man/X.7#COLOR_NAMES and it looks
like #RRGGBB is one of several deprecated formats for specifying a
color. I can't tell about the case, though. We allow 6-8 characters
though, when it looks like it should be 3, 6, 9, or 12 nibbles.
However I think we can only use 6 characters (and that we shouldn't
accept 8 characters (#RRGGBBAA) as alpha is not allowed and it could be
a substring of #RRRGGGBBB or #RRRRGGGGBBBB.)

We could allow converting up #RGB to #R0G0B0 as X would do though.

This removes the support for #RRGGBBAA format, while allowing for using #defines, rgb:<r>/<g>/<b>, rgbi:<r>/<g>/<b>, as well as colors defined in rgb.txt.

This does not support processing #include.

As observed in greshake#2230:

> I found https://man.archlinux.org/man/X.7#COLOR_NAMES and it looks
> like #RRGGBB is one of several deprecated formats for specifying a
> color. I can't tell about the case, though. We allow 6-8 characters
> though, when it looks like it should be 3, 6, 9, or 12 nibbles.
> However I think we can only use 6 characters (and that we shouldn't
> accept 8 characters (#RRGGBBAA) as alpha is not allowed and it could be
> a substring of #RRRGGGBBB or #RRRRGGGGBBBB.)

> We could allow converting up #RGB to #R0G0B0 as X would do though.

This removes the support for #RRGGBBAA format, while allowing for
using `#define`s, `rgb:<r>/<g>/<b>`, `rgbi:<r>/<g>/<b>`, as well as
colors defined in `rgb.txt`.

This does not support processing `#include`.
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