From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#61188: 30.0.50; color-lighten-name seems not to work Date: Mon, 30 Jan 2023 23:58:26 +0100 Message-ID: <87wn53iq99.fsf@rub.de> References: <03DC6549-C68D-449B-92F8-BA3E9EB5AC5B@fastmail.co.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24280"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61188@debbugs.gnu.org To: "Mark Bestley" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 30 23:59:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pMd7N-00060H-N3 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Jan 2023 23:59:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMd79-00072P-O3; Mon, 30 Jan 2023 17:59:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMd79-000724-1A for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2023 17:59:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMd78-00039U-AP for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2023 17:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pMd77-0001aC-SO for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2023 17:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Jan 2023 22:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61188 X-GNU-PR-Package: emacs Original-Received: via spool by 61188-submit@debbugs.gnu.org id=B61188.16751195186053 (code B ref 61188); Mon, 30 Jan 2023 22:59:01 +0000 Original-Received: (at 61188) by debbugs.gnu.org; 30 Jan 2023 22:58:38 +0000 Original-Received: from localhost ([127.0.0.1]:50873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMd6j-0001ZZ-Rm for submit@debbugs.gnu.org; Mon, 30 Jan 2023 17:58:38 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:52127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMd6i-0001ZK-1w for 61188@debbugs.gnu.org; Mon, 30 Jan 2023 17:58:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1675119507; bh=VN+NktC2NguzWdKCs76XE/gtulY9GrUPsbfii6gL+O8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=BLAw//n8xZPlVg/ZRv9D06UCiSORiy5Xz7X0XuNqKX9Dfs39k8NddDzPrD0YZv7xY bV5DoGiNiJNzl8BBVOon/eZ61HMnbzNZsegImDqBgfB52znsNWmbyHhysNY0hvBex9 VxMCOIioafLFjuVJaCJ7btZP2mpsk0WrO+kLUEum/6XDqGELKQZNEg5583L8G1rHNt LpTuFwVb2eeS3j80R0r6tuA9G3SJm39SAfLQoqVrOT7/JUjUcOlqCpl1y/2wWBAnyq WnDCjxiAfk/jCNpJ24DvOXXFV7YJbgHOvzmfkSaR2SlZtJKtjP/YPXUwExxajaYuXC QZaZI/pt1RXRg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs ([89.246.36.163]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mk0NU-1ouC7O3xaS-00kNIA; Mon, 30 Jan 2023 23:58:27 +0100 In-Reply-To: <03DC6549-C68D-449B-92F8-BA3E9EB5AC5B@fastmail.co.uk> (Mark Bestley's message of "Mon, 30 Jan 2023 21:48:20 +0000") X-Provags-ID: V03:K1:RpE9i+mqahkUZZXto3PnjTKZS0pXKi24KftdhRoHW/tt4mW4eu8 E1rYWj7ICrL7Jl45olLMcqaZZWZ//1hz0/HWRblZqaDHYs5gjpJT9Gc4hJ/tDB/rC0Hsszp xj0dE6g84j4qdwb0QlF9+TB5EipuLb5p8bKE0D7isgduKokxceYmLoQM1zyN/IXrwQztrJI FJslgATyGZfwcPf8Dowfw== UI-OutboundReport: notjunk:1;M01:P0:rvGmY7jR/YU=;2QlI36yylFc3jq7s86KIfwHI1Mq pClobiWOldW2vn7zhF3V3+6CHVRW88yXsuKWyl5qN9/kcA5RxfoqwGkAr2UIuZ97JxqKbI+/y fVmYqVFOSTB4vuoo85SruYf7C23a9Yn6WzUOGR7v4tDdlnWVJ+g0dnHn8Y9m4q9yPVTy/JRd0 4+C36/S0OQdYh7pDF921hvENJkdHKblDmPB1g1OUQltFJUj7zjxaqdGC0kf6sHnD8jwrMiN4f ykJVfops3LQbQFb/rStn5NZGz9abHv/5xoYUhkTauxFhzY8E+85ahEN9sOsaEEVObjJm5dZEj YjLLpySCTwKWnXFWSJw5jDt3jxrChMolvK03nnkkJ04byaD2dMJsiAVK7uwSnxTS5rEfPec0n 48gd4/Kdx43m9nrI+MNJBFWe/tE2L6++jtndLhAMuE5SLlrWfmPAFOLjhYiRjUNTSL0xi9Urs 1EEdemjzYRKecfX3PBmo3O9pMkGQtl7kWl2HPtVZyxx3Th1E8+NqLEJCV4pXqRVWsgQ4jGkXI 9PzQQ1JGvzJJEAChTHmGZh653QMFCBygkCfSwlnW3FgGItOT5+Q+3S4uh1CHBgmxW3bl+7/Uf w4WKEdsCLnXsUorcXpu4OwaY0Gy0bfj9O2mRBR9pxbnbvWjz6aHRdfEmwq0qLDKahAI+weaNh k1vGNUeKuK4G40u3ihGtKNedg4CAFQd2f79sZjknKJouZHPpvbQz+omF1hWCnaNGyQpmv/mrQ rGfDUV+wAxyInYz/R8FJQ/OngYMQaDc71DIVoKtnlMb6iM2w8L1ou9FSx/67ja7cZcAvl1K1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254491 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 30 Jan 2023 21:48:20 +0000 "Mark Bestley" wrot= e: > Look at the results of > > (require 'color) > (message "reduce by 100 =3D %s" (color-lighten-name "Black" 100)) > (message "reduce by 0 =3D %s" (color-lighten-name "Black" 0)) > > In emacs 28.2 they give "#ffffffffffff" and 0 as expected. > In emacs 30.0.50 they give 0 and 0 This difference is due to this commit: commit 656c2dd66e77a5fbeb99d358017e8327401fae05 Author: Lars Ingebrigtsen Commit: Lars Ingebrigtsen CommitDate: Tue Mar 22 15:28:02 2022 +0100 Fix color-lighten-hsl logic * lisp/color.el (color-lighten-hsl): Lighten by percentage, instead of just adding the specified number to the luminance element (bug#54514). The patch below restores the Emacs 28 result for the above examples while keeping the desired result for the example in bug#54514, but I have no idea if it yields undesirable results in other cases. Steve Berman --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: color-lighten-hsl patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/color.el b/lisp/color.el index f68cf5e6b17..a251b1a24a0 100644 =2D-- a/lisp/color.el +++ b/lisp/color.el @@ -407,7 +407,7 @@ color-lighten-hsl Given a color defined in terms of hue, saturation, and luminance \(arguments H, S, and L), return a color that is PERCENT lighter. Returns a list (HUE SATURATION LUMINANCE)." - (list H S (color-clamp (+ L (* L (/ percent 100.0)))))) + (list H S (color-clamp (+ L (* (if (> L 0) L 1) (/ percent 100.0)))))) (defun color-lighten-name (name percent) "Make a color with a specified NAME lighter by PERCENT. --=-=-=--