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: Sat, 04 Mar 2017 10:43:01 +0200 Message-ID: <83lgsll9ey.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>>> <<<83pohyky8i.fsf@gnu.org>>> <> <<83o9xikvop.fsf@gnu.org>> <1b96dc61-19bb-486b-a408-c3b3c15e113b@default> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1488617053 32546 195.159.176.226 (4 Mar 2017 08:44:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 4 Mar 2017 08:44:13 +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 Sat Mar 04 09:44:07 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 1ck5IN-0007y1-Ax for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Mar 2017 09:44:07 +0100 Original-Received: from localhost ([::1]:34425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ck5IT-0002bE-9y for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Mar 2017 03:44:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ck5IL-0002aA-MO for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 03:44:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ck5II-0000um-KB for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 03:44:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40900) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ck5II-0000ue-GG for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 03:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ck5II-0007VT-6f for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 03:44: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: Sat, 04 Mar 2017 08:44: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.148861700928810 (code B ref 25890); Sat, 04 Mar 2017 08:44:02 +0000 Original-Received: (at 25890) by debbugs.gnu.org; 4 Mar 2017 08:43:29 +0000 Original-Received: from localhost ([127.0.0.1]:39099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ck5Hk-0007Ub-PD for submit@debbugs.gnu.org; Sat, 04 Mar 2017 03:43:28 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ck5Hj-0007UP-W2 for 25890@debbugs.gnu.org; Sat, 04 Mar 2017 03:43:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ck5Hd-0000lr-T2 for 25890@debbugs.gnu.org; Sat, 04 Mar 2017 03:43:22 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ck5HX-0000lB-TJ; Sat, 04 Mar 2017 03:43:15 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3523 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ck5HW-0005jc-KP; Sat, 04 Mar 2017 03:43:15 -0500 In-reply-to: <1b96dc61-19bb-486b-a408-c3b3c15e113b@default> (message from Drew Adams on Fri, 3 Mar 2017 13:18:12 -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:130153 Archived-At: > Date: Fri, 3 Mar 2017 13:18:12 -0800 (PST) > From: Drew Adams > Cc: michael_heerdegen@web.de, 25890@debbugs.gnu.org, rasmus@gmx.us > > You said: > > > 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. > > `hexrgb-int-to-hex' just converts integer RGB to hex RGB. > And it converts integer 57568 to E0E0, which you now agree > is correct. > > Perhaps you can elaborate a bit on what you think the bug is? I already did, but you didn't want to hear, claiming that I repeat myself. Here it is again: the problem is in hexrgb-int-to-hex. It does this: (substring (format (concat "%0" (int-to-string nb-digits) "X") int) (- nb-digits)) which assumes that the digits to be produced, if n in the %0nX format is too small and doesn't allow to produce all of them, are the least-significant digits of the number. It should instead produce the most-significant digits. IOW, when #FFFFFF is converted to 16-bit per color component, it should yield #FF00FF00FF00, not #FFFFFFFFFFFF.