all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mark Bestley" <gnu@bestley.co.uk>
To: "Eli Zaretskii" <eliz@gnu.org>
Cc: Stephen Berman <stephen.berman@gmx.net>, 61188@debbugs.gnu.org
Subject: bug#61188: 30.0.50; color-lighten-name seems not to work
Date: Thu, 02 Feb 2023 18:32:50 +0000	[thread overview]
Message-ID: <d2bb2995-2acf-4701-884e-58fecd3d347b@app.fastmail.com> (raw)
In-Reply-To: <81E109CF-91D3-412A-87FC-2839ABFF4788@fastmail.co.uk>

[-- Attachment #1: Type: text/plain, Size: 2718 bytes --]



On Thu, 2 Feb 2023, at 15:46, Mark Bestley wrote:
>  * 
> 
>> On 1 Feb 2023, at 17:18, Eli Zaretskii <eliz@gnu.org> wrote:
>> 
>>> Date: Wed, 01 Feb 2023 14:11:13 +0000
>>> From: "Mark Bestley" <gnu@bestley.co.uk>
>>> Cc: 61188@debbugs.gnu.org
>>> 
>>>> So I guess the current behavior is the intended one, and we should
>>>> close this bug as wontfix?
>>> 
>>> No - I think the way 28.2 worked was correct. (for impact see highlight-indent.el which now does not work with a black background )
>> 
>> But by changing the tests to match what Emacs does now we explicitly
>> said that we disagree, and that the current behavior is the correct
>> one.
>> 
>>> What is the expected value of (color-lighten-name  "Black" 100) as I don't know where that test is. I would think the test is wrong. Did it run for 28.2?
>> 
>> The test is in test/lisp/color-tests.el.  The expected value is
>> exactly what you said is wrong.
>> 
>>> Surely lightening Black fully should give white
>> 
>> How so?  The 100 is the percentage of the present luminance, and if
>> that is zero, why do you expect it to become lighter?
>> 
>> See also the discussion in bug#54514, which was exactly about that.
> 
> I don't see a discussion there.
> But I do understand and accept the rationale for changing * color-lighten-hsl*
> 
> 
> 
>> 
>>> In 30 olor-lighten-name  "Black" of any positive value gives Black - surely this cannot be correct.
>> 
>> A zero multiplied by any percentage stays zero, no?  If you want a
>> non-zero result, start with something close to black, but not actually
>> black.
> The issue is more with color-lighten-name and the use it has in highlight-indent.el
> Here the background colour is increased or darkened so that a new background is  distinguishable from the original and it does that via varying the hue. In those terms increasing the hue from black to shades of grey and 100% takes you to white makes sense.
> 
> So just multiplying hue may not give the expected result here, The old reasoning for color-by-name might make some sense but I don't think we have the rationale why that was chosen.
> 
> So I understand why then change was made but I think that there will be broken code around which used color-lighten-name when emacs 29 is released.
> 
> Basically manipulation of coper values is more complex than at first thought.
> 
> I'll report this issue to highlight-indent.el and I think this bug can be closed,
Sorry for the further post 

I looked at the old tests for color-lighten-hsl and see their rationale.

The old code added the percentage change to the hue the new code multiplies by the change.
So their is rationale to that but the comment for the function is not exact enough.
--
Mark



[-- Attachment #2: Type: text/html, Size: 7363 bytes --]

  reply	other threads:[~2023-02-02 18:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 21:48 bug#61188: 30.0.50; color-lighten-name seems not to work Mark Bestley
2023-01-30 22:58 ` Stephen Berman
2023-01-31 18:39   ` Eli Zaretskii
2023-01-31 20:34     ` Stephen Berman
2023-02-01 13:21       ` Eli Zaretskii
2023-02-01 14:11         ` Mark Bestley
2023-02-01 17:18           ` Eli Zaretskii
2023-02-02 15:46             ` Mark Bestley
2023-02-02 18:32               ` Mark Bestley [this message]
2023-02-21 13:08 ` Bernd Rellermeyer

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2bb2995-2acf-4701-884e-58fecd3d347b@app.fastmail.com \
    --to=gnu@bestley.co.uk \
    --cc=61188@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=stephen.berman@gmx.net \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.