[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: list-colors-display: display all color names

From: Eli Zaretskii
Subject: Re: list-colors-display: display all color names
Date: Wed, 05 Jan 2005 20:59:16 +0200

> Cc: address@hidden
> From: Juri Linkov <address@hidden>
> Date: Wed, 05 Jan 2005 07:32:52 +0200
> > How about adding a function color-values-hex, which calls color-values
> > and then transforms the result into the hex #RGB notation?  Would that
> > fix this problem?
> A function is not a problem.  A simple piece of code like this
>          (apply 'format " #%02x%02x%02x"
>                  (mapcar (lambda (c) (lsh c -8)) (color-values color)))
> can do that.  Creating a special function with this code will not
> fix this problem since users might not be aware of such a function.

Users might be oblivious to the existence of `list-colors-display' as
well.  This kind of arguments will not lead us anywhere.

Also, we could add more text to the *Colors* buffer telling users
about related facilities.  But I doubt that this is a grave problem.
Someone who wouldn't hesitate to modify colors one bit at a time is
probably a hacker anyway, and hackers could well be expected to look
for related functions.

> Adding #RGB to every color name displayed by `list-colors-display'
> in the *Colors* buffer is a more practical solution.

But it clutters the display and creates a problem with long lines.  So
I think we need a good reason for adding that.

One idea that I like better is to add tooltips to the colors which
show the hex RGB values.  How about this?

> >> Also, users might want to find the color name corresponding to
> >> the known RGB value.
> >
> > For more-or-less standard RGB values, the ones listed in
> > tty-colors.el, doing that is simply a matter of searching the alist
> > returned by tty-color-alist; if trhat is what you want, does this
> > justify a new feature?
> RGB values returned by tty-color-alist are represented as integers
> 0-65535 while the most widespread format for specifying color triplets
> is hexadecimal #RRGGBB.

Sure, but converting to hex is trivial, more or less.

> 4 digits per color?  Why?

So that we could support more than 8 bits per principal color.  Since
X supports that, when tty-colors was written, we anticipated that
someone might use a 12-digit spec on a tty.

> what I want to say is that using any format longer than #RRGGBB is
> too impractical.

What's impractical about it?  You can compute 12 hex digits as
practically as you can 3 or 6.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]