GNU bug report logs - #74055
31.0.50; color-lighten-name not lightening black

Previous Next

Package: emacs;

Reported by: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Date: Mon, 28 Oct 2024 08:29:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 74055 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 Julien Danjou <julien <at> danjou.info>,
 Mattias Engdegård <mattiase <at> acm.org>
Cc: Noah Friedman <noah <at> splode.com>, 74055 <at> debbugs.gnu.org
Subject: Re: bug#74055: 31.0.50; color-lighten-name not lightening black
Date: Mon, 28 Oct 2024 14:39:17 +0200
> From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
> Date: Mon, 28 Oct 2024 09:27:29 +0100
> 
> The function color-lighten-name doesn't work as I would expect for
> black:
> 
>   (color-lighten-name "#000000" 50)
>   => "#000000000000"
> 
> I think there is even a test that checks that, in color-tests.el:
> 
> (ert-deftest color-tests-lighten-name ()
>   (should (equal (color-lighten-name "black" 100) "#000000000000"))
> 
> I don't understand this, and it is different from what I'd expect, and
> tools for the web return, for example
> 
>   https://mdigi.tools/lighten-color/#000000

Our notion of "lighten color" seems to be to increase the color's
luminance by P percent.  Since the black color's luminance is zero,
increasing that by 50% still yields zero.

By contrast, the page you point to seems to interpret "lighten" to
mean that P is the percentage of the full scale, not of the original
color's luminance.

This goes back to commit 656c2dd66e, which was supposed to fix
bug#54514.  But maybe Noah's interpretation of "lighten" was
incorrect, and we should revert that change?  OTOH, if we do revert
it, then Noah's example will disagree with the above page.

So I guess our algorithm is incorrect somewhere?

Adding Julien and Mattias, in the hope that they could help unconfuse
us.




This bug report was last modified 277 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.