From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: list-colors-display: display all color names Date: Wed, 05 Jan 2005 07:38:28 +0200 Organization: JURTA Message-ID: <874qhwzb8r.fsf@jurta.org> References: <87d5wwsuly.fsf@jurta.org> <87brc5a99w.fsf@jurta.org> <01c4f2a1$Blat.v2.2.2$dde14140@zahav.net.il> <87vfackhi9.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1104903654 6948 80.91.229.6 (5 Jan 2005 05:40:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Jan 2005 05:40:54 +0000 (UTC) Cc: eliz@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 05 06:40:43 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cm3uV-000576-00 for ; Wed, 05 Jan 2005 06:40:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cm45j-0005bo-PD for ged-emacs-devel@m.gmane.org; Wed, 05 Jan 2005 00:52:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Cm45a-0005bW-Fm for emacs-devel@gnu.org; Wed, 05 Jan 2005 00:52:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Cm45Y-0005b1-Aw for emacs-devel@gnu.org; Wed, 05 Jan 2005 00:52:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cm45W-0005ar-R1 for emacs-devel@gnu.org; Wed, 05 Jan 2005 00:52:07 -0500 Original-Received: from [194.126.101.98] (helo=MXR-3.estpak.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cm3tu-00042m-Ga; Wed, 05 Jan 2005 00:40:06 -0500 Original-Received: from mail.neti.ee (80-235-33-160-dsl.mus.estpak.ee [80.235.33.160]) by MXR-3.estpak.ee (Postfix) with ESMTP id B5F1BEE070; Wed, 5 Jan 2005 07:39:52 +0200 (EET) Original-To: Stefan Monnier In-Reply-To: <87vfackhi9.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 04 Jan 2005 16:57:05 -0500") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:31877 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:31877 Stefan Monnier writes: >>> Also, users might want to find the color name corresponding to >>> the known RGB value. > >> Is there any reasonably practical way to do that for an arbitrary RGB >> triplet? > > A guess a function that returns the closest color-name would be good enough. > What that's good for, I don't know. There is already such a function: `tty-color-approximate' (currently it works only for tty colors). I don't know how it is useful from the user's POV. What I intended with adding #RRGGBB values was to make it easier for users getting somewhere a #RRGGBB value to see if there is a corresponding easily rememberable color name. With #RRGGBB values printed in the *Colors* buffer it would be possible to find closer color names even without a function, simply with a regexp isearch like M-C-s #f.[fe].e. It will not find the closest color name, but it is good enough to help to find all closer colors. Even better would be if the *Colors* buffer was sorted by RGB values. I don't suggest to do that by default, but different sorting order would be useful, e.g. by color name, by color intensity. The latter is good for finding a darker or brighter color than a given color, but it is not so obvious since there are too many variants of projecting a color value from 3-D color space into a 1-D color list. Perhaps the most useful is sorting by hue into a rainbow, and inside every hue sorting by value*saturation. >>> 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. > > I agree on the `#'. I omitted the `#' to save more space. But OK, one character is not too much to remind the users about the proper format. -- Juri Linkov http://www.jurta.org/emacs/