unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Eli Zaretskii" <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: list-colors-display: display all color names
Date: Wed, 05 Jan 2005 20:59:16 +0200	[thread overview]
Message-ID: <01c4f358$Blat.v2.2.2$cd1cb9e0@zahav.net.il> (raw)
In-Reply-To: <87d5wkzbi3.fsf@jurta.org> (message from Juri Linkov on Wed, 05 Jan 2005 07:32:52 +0200)

> Cc: emacs-devel@gnu.org
> From: Juri Linkov <juri@jurta.org>
> 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.

  parent reply	other threads:[~2005-01-05 18:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-26 19:45 list-colors-display: display all color names Juri Linkov
2004-12-28  4:57 ` Richard Stallman
2005-01-04  9:07   ` Juri Linkov
2005-01-04 16:37     ` Drew Adams
2005-01-04 21:09     ` Eli Zaretskii
2005-01-04 21:57       ` Stefan Monnier
2005-01-05  5:38         ` Juri Linkov
2005-01-05 18:12           ` Drew Adams
2005-01-05 19:11           ` Eli Zaretskii
2005-01-05 19:21             ` Edward O'Connor
2005-01-06  4:35               ` Eli Zaretskii
2005-01-05  5:32       ` Juri Linkov
2005-01-05 18:12         ` Drew Adams
2005-01-05 19:13           ` Eli Zaretskii
2005-01-05 18:59         ` Eli Zaretskii [this message]
2005-01-05 19:46           ` Drew Adams
2005-01-06  4:50             ` Eli Zaretskii
2005-01-06  8:27           ` Juri Linkov
2005-01-06  9:05             ` Miles Bader
2005-01-06 10:44               ` Juri Linkov
2005-01-05 20:08       ` Richard Stallman
2005-01-05  3:30     ` Richard Stallman
2005-01-06  8:29       ` Juri Linkov
2004-12-29 14:46 ` Michael Mauger
2004-12-29 19:02   ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='01c4f358$Blat.v2.2.2$cd1cb9e0@zahav.net.il' \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).