unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: 4033@emacsbugs.donarmstrong.com
Subject: bug#4033: 23.1; list-colors-display is misleading
Date: Thu, 06 Aug 2009 00:35:43 +0300	[thread overview]
Message-ID: <87ws5i9c5s.fsf@mail.jurta.org> (raw)
In-Reply-To: <6875A66084B7406B8409F2C495A75D26@us.oracle.com> (Drew Adams's message of "Tue, 4 Aug 2009 19:25:26 -0700")

> What about something like this:
>
> (defun rgb-color-format-for-display ()
>   (let ((ncolors  (display-color-cells (selected-frame)))
>         (exp      0))
>     (while (> (lsh ncolors (- exp)) 1) (setq exp  (1+ exp)))
>     (setq exp  (/ exp 12))
>     (format "#%%0%dx%%0%dx%%0%dx" exp exp exp)))
>
> For 16777216 colors, that gives #%02x%02x%02x, which seems right.
>
> In `list-colors-print', we would then do this:
>
> (insert (apply 'format (rgb-color-format-for-display)
>                (mapcar (lambda (c) (lsh c -8))
>                          (color-values (car color)))))
>
> IOW, replace the hard-coded "#%02x%02x%02x" with (rgb-color-format-for-display).
>
> But I guess Jason and Eli are saying that that wouldn't work or wouldn't be
> appropriate. It's still not clear to me.

I don't understand what is the reason to unnecessarily complicate this.
In your original report you said that one user had some confusion with
hex formats.  Is this user using a system supporting more than 8 bits
per component?

-- 
Juri Linkov
http://www.jurta.org/emacs/





  parent reply	other threads:[~2009-08-05 21:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-04 16:01 bug#4033: 23.1; list-colors-display is misleading Drew Adams
2009-08-04 18:04 ` Eli Zaretskii
2009-08-04 18:48   ` Drew Adams
2009-08-04 19:40     ` Drew Adams
2009-08-04 19:45       ` Eli Zaretskii
2009-08-04 19:58         ` Drew Adams
2009-08-04 22:59     ` Jason Rumney
2009-08-04 23:29       ` Drew Adams
2009-08-04 23:42         ` Jason Rumney
2009-08-04 23:55           ` Drew Adams
2009-08-05  3:22             ` Eli Zaretskii
2009-08-05  5:34               ` Drew Adams
2009-08-05  6:57                 ` Jason Rumney
2009-08-05 17:34                   ` Eli Zaretskii
2009-08-04 23:27   ` Andreas Schwab
2009-08-04 21:35 ` Juri Linkov
2009-08-04 23:29   ` Drew Adams
2009-08-05  2:25   ` Drew Adams
2009-08-05  2:58     ` Drew Adams
2009-08-05 21:35     ` Juri Linkov [this message]
2009-08-05 23:16       ` Drew Adams
2009-08-05  2:36   ` Drew Adams

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=87ws5i9c5s.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=4033@emacsbugs.donarmstrong.com \
    --cc=drew.adams@oracle.com \
    /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).