From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#25890: `color-values` gives wrong value Date: Tue, 28 Feb 2017 15:54:46 -0800 (PST) Message-ID: <56bad9de-8111-4962-a9e9-2dbf0084e004@default> References: <87zih7n2yt.fsf@pank.eu> <83r32jpr8b.fsf@gnu.org> <87bmtnryqr.fsf@drachen> <87d1e2tzt5.fsf@pank.eu> <8337eypb5l.fsf@gnu.org> <87vartx4qd.fsf@drachen> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1488326114 12428 195.159.176.226 (28 Feb 2017 23:55:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Feb 2017 23:55:14 +0000 (UTC) Cc: 25890@debbugs.gnu.org, Rasmus To: Michael Heerdegen , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 01 00:55:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cirbm-0002SH-0P for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Mar 2017 00:55:06 +0100 Original-Received: from localhost ([::1]:37714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cirbs-0000GN-4H for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Feb 2017 18:55:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cirbm-0000Eb-29 for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 18:55:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cirbi-0003gG-Rh for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 18:55:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34268) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cirbi-0003gC-OR for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 18:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cirbi-0005pK-IZ for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 18:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Feb 2017 23:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25890 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25890-submit@debbugs.gnu.org id=B25890.148832610022387 (code B ref 25890); Tue, 28 Feb 2017 23:55:02 +0000 Original-Received: (at 25890) by debbugs.gnu.org; 28 Feb 2017 23:55:00 +0000 Original-Received: from localhost ([127.0.0.1]:60700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cirbg-0005p1-E1 for submit@debbugs.gnu.org; Tue, 28 Feb 2017 18:55:00 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:35245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cirbe-0005og-5d for 25890@debbugs.gnu.org; Tue, 28 Feb 2017 18:54:58 -0500 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v1SNsolj007177 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 Feb 2017 23:54:51 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v1SNsoHv010004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 Feb 2017 23:54:50 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v1SNsmtK028672; Tue, 28 Feb 2017 23:54:49 GMT In-Reply-To: <87vartx4qd.fsf@drachen> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129967 Archived-At: > > (defun color-rgb-to-hex (red green blue) > > "Return hexadecimal notation for the color RED GREEN BLUE. > > RED, GREEN, and BLUE should be numbers between 0.0 and 1.0, inclusive.= " > > - (format "#%02x%02x%02x" > > - (* red 255) (* green 255) (* blue 255))) > > + (format "#%04x%04x%04x" > > + (* red 65535) (* green 65535) (* blue 65535))) The function should accept an optional arg NB-DIGITS, which specifies the number of hex digits for each of R, G, B. And yes, it should default to 4 digits: #RRRRGGGGBBBB. (That's what the original function in hexrgb.el does, from which color.el was supposedly derived.)