From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25890: `color-values` gives wrong value Date: Fri, 03 Mar 2017 20:32:13 +0200 Message-ID: <83pohyky8i.fsf@gnu.org> References: <<87zih7n2yt.fsf@pank.eu>> <<83r32jpr8b.fsf@gnu.org>> <<87bmtnryqr.fsf@drachen>> <<87d1e2tzt5.fsf@pank.eu>> <<8337eypb5l.fsf@gnu.org>> <<87vartx4qd.fsf@drachen>> <<56bad9de-8111-4962-a9e9-2dbf0084e004@default>> <<83wpc6la28.fsf@gnu.org>> <2cfd6280-34de-4751-b35f-ec7d47a16595@default> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1488565991 18550 195.159.176.226 (3 Mar 2017 18:33:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 3 Mar 2017 18:33:11 +0000 (UTC) Cc: michael_heerdegen@web.de, 25890@debbugs.gnu.org, rasmus@gmx.us To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 03 19:33:06 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 1cjs0n-0004PQ-TS for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Mar 2017 19:33:06 +0100 Original-Received: from localhost ([::1]:59604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjs0u-0006jC-1o for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Mar 2017 13:33:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjs0n-0006j4-RR for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 13:33:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjs0k-0007CI-Kz for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 13:33:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40567) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjs0k-0007CE-Hd for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 13:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cjs0k-0005vB-BI for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 13:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Mar 2017 18:33: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.148856596322734 (code B ref 25890); Fri, 03 Mar 2017 18:33:02 +0000 Original-Received: (at 25890) by debbugs.gnu.org; 3 Mar 2017 18:32:43 +0000 Original-Received: from localhost ([127.0.0.1]:38766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjs0Q-0005ub-4k for submit@debbugs.gnu.org; Fri, 03 Mar 2017 13:32:43 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjs0O-0005uP-Lm for 25890@debbugs.gnu.org; Fri, 03 Mar 2017 13:32:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjs0I-0006yd-LK for 25890@debbugs.gnu.org; Fri, 03 Mar 2017 13:32:35 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjs0C-0006wC-QA; Fri, 03 Mar 2017 13:32:28 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3121 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cjs0B-0001fD-Ua; Fri, 03 Mar 2017 13:32:28 -0500 In-reply-to: <2cfd6280-34de-4751-b35f-ec7d47a16595@default> (message from Drew Adams on Fri, 3 Mar 2017 07:49:33 -0800 (PST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:130124 Archived-At: > Date: Fri, 3 Mar 2017 07:49:33 -0800 (PST) > From: Drew Adams > Cc: michael_heerdegen@web.de, 25890@debbugs.gnu.org, rasmus@gmx.us > > > The code in hexrgb.el produces strange results in this regard (e.g., > > it produces "#FFFFFFFFE0E0" instead of "#FFFFFFFFE000" for the color > > mentioned by the OP). > > Not clear what you are saying. What color mentioned by the OP? > Do you mean "light yellow"? What sexp using hexrgb.el did you try? > > If I do (hexrgb-color-name-to-hex "light yellow") I do get > "#FFFFFFFFE0E0". That comes from `x-color-values' returning > (65535 65535 57568) and `hexrgb-int-to-hex' converting 57568 > to "E0E0". That's from (format "%04X" 57568). Hex conversion > of decimal 57568 _should_ be E0E0, AFAIK. Where is the bug? The bug is in hexrgb-int-to-hex: it incorrectly assumes that it should produce the LSB part of the number, while it actually should produce the MSB part.