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

Heime <[email protected]> Fri, 17 Jul 2026 14:55:28 +0000
Newsgroups gmane.emacs.help
Message-ID <oql0A2DUZ5TB3nzvIN8bKpfl7r0vQFha0OJ0_nAXQkJCQOrPrpHUhO7SdSciyZRYc2m9aF1XLIBISWbfu-nKllzRnH9pG_YOsNzeGp3S7lM=@protonmail.com>



Sent with Proton Mail secure email.

On Saturday, July 18th, 2026 at 2:34 AM, Eli Zaretskii <[email protected]> wrote=
:

> > Date: Fri, 17 Jul 2026 14:28:11 +0000
> > From: Heime <[email protected]>
> > Cc: uzibalqa <[email protected]>, [email protected], help-gnu-emacs@gn=
u.org
> >
> >
> >
> >
> >
> > Sent with Proton Mail secure email.
> >
> > On Saturday, July 18th, 2026 at 1:33 AM, Eli Zaretskii <[email protected]> w=
rote:
> >
> > > > Date: Fri, 17 Jul 2026 13:22:13 +0000
> > > > From: uzibalqa <[email protected]>
> > > > Cc: Heime <[email protected]>, [email protected], help-gnu=
[email protected]
> > > >
> > > > If the advice is always to use #RRRRGGGGBBBB, which is also always =
the advice
> > > > for my cases,  then how (list-colors-display) showing me #RRGGBB fo=
llows the
> > > > advice you described?  To follow your advice, display #RRRRGGGGBBBB=
, not
> > > > the currently displayed #RRGGBB.
> > >
> > > Are you writing list-colors-display?  If not, why is it important tha=
t
> > > it shows 6-digit RGB values?
> >
> > Because colour-values on the name are in range 0-65535, a range that
> > definitly requires hex RRRR and not hex RR.  The hex value is unique,
> > consequently using  RR instead of RRRR is incorrect.
> >
> > Multiple (0-65535) values map to the same #RR value, breaking uniquenes=
s
> > and accuracy.  Colour accuracy matters for contrast calculations, acces=
sibility,
> > and precise colour matching.  The emphasis on the importance of 6-digit
> > hex values is that they uniquely and accurately represent the colour in
> > the standard hex format.
>=20
> All of the above are reasons to use 16-bit values for each RGB
> component.  That way, you don't lose accuracy when specifying a color.


list-colors-display is an interactive function in facemenu.el, which is
part of GNU Emacs.  It should look at the range of values and determine
whether #RRRRGGGGBBBB should be used as display. =20