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 16:08:35 +0200 Message-ID: <83y3wmlafw.fsf@gnu.org> References: <87zih7n2yt.fsf@pank.eu> <83r32jpr8b.fsf@gnu.org> <87bmtnryqr.fsf@drachen> <87d1e2tzt5.fsf@pank.eu> <8337eypb5l.fsf@gnu.org> <87r32hs4mt.fsf@gmx.us> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1488550220 8274 195.159.176.226 (3 Mar 2017 14:10:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 3 Mar 2017 14:10:20 +0000 (UTC) Cc: 25890-done@debbugs.gnu.org To: Rasmus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 03 15:10:15 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 1cjnuP-0001dJ-9F for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Mar 2017 15:10:13 +0100 Original-Received: from localhost ([::1]:58323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnuV-0008B9-FV for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Mar 2017 09:10:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnuI-00083u-RO for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 09:10:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjnuE-0004sd-AD for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 09:10:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39355) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjnuE-0004sT-6p for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 09:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cjnuE-0006Fl-2G for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 09:10:02 -0500 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Mar 2017 14:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 25890 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 25890@debbugs.gnu.org, eliz@gnu.org, rasmus@gmx.us Original-Received: via spool by 25890-done@debbugs.gnu.org id=D25890.148855014823970 (code D ref 25890); Fri, 03 Mar 2017 14:10:01 +0000 Original-Received: (at 25890-done) by debbugs.gnu.org; 3 Mar 2017 14:09:08 +0000 Original-Received: from localhost ([127.0.0.1]:37553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjntM-0006EY-3w for submit@debbugs.gnu.org; Fri, 03 Mar 2017 09:09:08 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjntK-0006E1-Br for 25890-done@debbugs.gnu.org; Fri, 03 Mar 2017 09:09:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjntB-0004bC-ND for 25890-done@debbugs.gnu.org; Fri, 03 Mar 2017 09:09:00 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjntB-0004b8-Jf; Fri, 03 Mar 2017 09:08:57 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2959 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cjntA-0008Rr-AT; Fri, 03 Mar 2017 09:08:57 -0500 In-reply-to: <87r32hs4mt.fsf@gmx.us> (message from Rasmus on Wed, 01 Mar 2017 10:55:22 +0100) 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:130108 Archived-At: > From: Rasmus > Date: Wed, 01 Mar 2017 10:55:22 +0100 > > Eli Zaretskii writes: > > > I think there's a bug in color.el: it assumes that the #RGB notation > > uses 24 bits, i.e. each component maxes out at 255. But Emacs does > > its color calculations based on 16-bit components, which max out at > > 65535, which is why #ffffff does NOT produce (65535 65535 65535), the > > white color. (We decided long ago to use 16-bit components because X > > APIs such as XParseColor on some systems, including yours, work with > > such components.) IOW, #ffffff is parsed as #ff00ff00ff00, and that > > is not "white". > > > > So I think the patch below is what is needed to fix this problem. Can > > you try it? (There's one user of the functions the patch changes, > > shr-color.el, which will need to be adapted to the change, if we > > decide to install it.) > > The test I used before now works for me: > > (set-frame-parameter (selected-frame) 'background-color > (color-darken-name "light yellow" 5)) > > Other noteworthy effects of the change were already addressed by Michael. Thanks, I installed my change with minor variations, and I'm marking this bug done.