From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#25890: `color-values` gives wrong value Date: Sat, 04 Mar 2017 16:44:28 +0100 Message-ID: References: <87zih7n2yt.fsf@pank.eu> <83r32jpr8b.fsf@gnu.org> <87bmtnryqr.fsf@drachen> <87d1e2tzt5.fsf@pank.eu> <8337eypb5l.fsf@gnu.org> <87r32hs4mt.fsf@gmx.us> <1488637440.20657.0@smtp.gmail.com> <83shmtjeem.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488642314 9583 195.159.176.226 (4 Mar 2017 15:45:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 4 Mar 2017 15:45:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 25890@debbugs.gnu.org, Simen =?UTF-8?Q?Heggest=C3=B8yl?= , rasmus@gmx.us To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 04 16:45:09 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 1ckBrm-0001oQ-QU for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Mar 2017 16:45:06 +0100 Original-Received: from localhost ([::1]:35744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckBrt-000752-0h for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Mar 2017 10:45:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckBrl-00073O-AU for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 10:45:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckBri-0003jc-8A for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 10:45:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ckBri-0003jC-31 for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 10:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ckBrh-0007si-KW for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 10:45:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Mar 2017 15:45:01 +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.148864227830247 (code B ref 25890); Sat, 04 Mar 2017 15:45:01 +0000 Original-Received: (at 25890) by debbugs.gnu.org; 4 Mar 2017 15:44:38 +0000 Original-Received: from localhost ([127.0.0.1]:40174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckBrJ-0007rn-Qv for submit@debbugs.gnu.org; Sat, 04 Mar 2017 10:44:38 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:55912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckBrI-0007re-Ld for 25890@debbugs.gnu.org; Sat, 04 Mar 2017 10:44:37 -0500 Original-Received: from cm-84.213.17.174.getinternet.no ([84.213.17.174] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (env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16:38:09 +0200") 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:130187 Archived-At: Eli Zaretskii writes: >> (apply #'color-rgb-to-hex `(,@(color-name-to-rgb "#ffffff") 2)) >> => "#fefefe" >> >> (apply #'color-rgb-to-hex `(,@(color-name-to-rgb "#fff") 2)) >> => "#efefef" >> >> Where I would like both to give back "#ffffff". Does this mean that I >> have to ensure that input to `color-name-to-rgb' uses 4 digits per >> component? > > Yes, IMO. Emacs does all its calculations with color components > assuming 16 bits per component. Applications that need to use fewer > digits and have the missing digits as something other than zero, need > to do that in application code. I haven't followed this discussion closely, but you've changed the way color-rgb-to-rgb works in an incompatible way? I don't think that makes much sense -- it's a function we must assume is used by third party code and that's supposed to return certain values on certain inputs. If you want to have a function that does something else, I think it would make more sense to introduce new functions that does this "something new" (i.e., 16 bit component parsing instead of HTML-like color parsing, which is what those functions are supposed to do), and revert the old functions how they used to work. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no