From: Eli Zaretskii <eliz@gnu.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>,
"Julien Danjou" <julien@danjou.info>,
"Mattias Engdegård" <mattiase@acm.org>
Cc: Noah Friedman <noah@splode.com>, 74055@debbugs.gnu.org
Subject: bug#74055: 31.0.50; color-lighten-name not lightening black
Date: Mon, 28 Oct 2024 14:39:17 +0200 [thread overview]
Message-ID: <86plnk766i.fsf@gnu.org> (raw)
In-Reply-To: <m2wmhsk4y6.fsf@gmail.com> (message from Gerd Möllmann on Mon, 28 Oct 2024 09:27:29 +0100)
> From: Gerd Möllmann <gerd.moellmann@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.
next prev parent reply other threads:[~2024-10-28 12:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 8:27 bug#74055: 31.0.50; color-lighten-name not lightening black Gerd Möllmann
2024-10-28 12:39 ` Eli Zaretskii [this message]
2024-10-28 15:18 ` Ship Mints
2024-10-28 16:57 ` Mattias Engdegård
2024-10-28 17:24 ` Eli Zaretskii
2024-10-29 4:41 ` Gerd Möllmann
2024-10-29 8:25 ` Gerd Möllmann
2024-10-29 12:54 ` Mattias Engdegård
2024-10-29 18:27 ` Gerd Möllmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86plnk766i.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=74055@debbugs.gnu.org \
--cc=gerd.moellmann@gmail.com \
--cc=julien@danjou.info \
--cc=mattiase@acm.org \
--cc=noah@splode.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).