From: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: RE: list-colors-display: display all color names
Date: Wed, 5 Jan 2005 10:12:36 -0800 [thread overview]
Message-ID: <FDELKNEBLPKKDCEBEJCBMEONCKAA.drew.adams@oracle.com> (raw)
In-Reply-To: <87d5wkzbi3.fsf@jurta.org>
>> it might be difficult for users to obtain corresponding hex values.
> 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.
Adding #RGB to every color name displayed by `list-colors-display'
in the *Colors* buffer is a more practical solution.
Adding hex codes to `list-colors-display' is good.
Having functions to convert decimal RGB to hex and vice versa is also good.
>> gray grey bebebe
>> light gray light grey, LightGray, LightGrey d3d3d3
> First, if we do that, I'd suggest to use #BE12BE34BE56, i.e. prefix
> with # and use 4 digits per color.
4 digits per color? Why? The human eye can distinguish no
more than about 400,000 colors (some say 10 million colors
which is the largest estimation) and can identify far less colors.
8 bits per color which encodes more than 16 million colors is
completely enough (usually even 600 colors displayed by
`list-colors-display' is enough). I won't argue about why
Emacs supports so many colors (10^14), but what I want to say
is that using any format longer than #RRGGBB is too impractical.
Whatever number of digits is needed to represent a given color should be
used in `list-colors-display'. It may be unlikely, but if two available
colors differ only in the 4th red digit, then their displayed hex codes
should reflect that and not appear to be identical - regardless of whether
our eyes can distinguish them. If all available colors happen to fit the
#RRGGBB format, then that will be sufficient, but why shoe-horn all colors
into that format?
In general, regarding Emacs Lisp that manipulates hex RGB codes: Is there a
reason not to treat an _arbitrary_ number (3*n) of hex digits? Or not to use
a variable for the number of digits to be treated? See
http://www.emacswiki.org/elisp/hexrgb.el for food-for-thought examples.
next prev parent reply other threads:[~2005-01-05 18:12 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 [this message]
2005-01-05 19:13 ` Eli Zaretskii
2005-01-05 18:59 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=FDELKNEBLPKKDCEBEJCBMEONCKAA.drew.adams@oracle.com \
--to=drew.adams@oracle.com \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.