Re: Retrieving color names and hex values using list-colors-display for coding purposes

Eli Zaretskii <[email protected]> Fri, 17 Jul 2026 15:44:05 +0300
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
> Date: Fri, 17 Jul 2026 12:10:15 +0000
> From: Heime <[email protected]>
> Cc: [email protected], [email protected]
> 
> On Friday, July 17th, 2026 at 11:21 PM, Eli Zaretskii <[email protected]> wrote:
> 
> > Understanding why we do in Emacs's sources what we do there requires a
> > lot of knowledge about the internal workings and the history of Emacs.
> > All of that is completely irrelevant to writing code on the level on
> > which you are now.  So please take the advice you are given and try
> > it, and only ask followup questions about "other ways of doing that"
> > if the advice doesn't work for some reason.
> > 
> > Okay?
> 
> What is the advice exactly?

The advice it to always use 4-hex digit specifications for the RGB
components, if you don't want to use color names.

> Which value should one use, the common #RRGGBB or the #RRRRGGGGBBBB.

For your cases, the latter, always the latter.

> For instance modus-themes uses #RRGGBB.

Leave that to the developers of modus-themes.

> Emacs internally uses 16-bit per component, but the displayed hex code
> is usually 6-digit.  Can't people see a problem with this!  

There is no problem.  You are just imagining a problem.