all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Simen Heggestøyl" <simenheg@runbox.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "Richard Copley" <rcopley@gmail.com>,
	"Mattias Engdegård" <mattiase@acm.org>,
	41544@debbugs.gnu.org
Subject: bug#41544: 26.3; Possible incorrect results from color-distance
Date: Sun, 07 Jun 2020 11:04:30 +0200	[thread overview]
Message-ID: <48285.0711954356$1591520716@news.gmane.org> (raw)
In-Reply-To: <83bllw82xt.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 06 Jun 2020 21:27:42 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> -(defun css--contrasty-color (name)
>> -  "Return a color that contrasts with NAME.
>> -NAME is of any form accepted by `color-distance'.
>> -The returned color will be usable by Emacs and will contrast
>> -with NAME; in particular so that if NAME is used as a background
>> -color, the returned color can be used as the foreground and still
>> -be readable."
>> -  ;; See bug#25525 for a discussion of this.
>> -  (if (> (color-distance name "black") 292485)
>> -      "black" "white"))
>> -
>>  (defcustom css-fontify-colors t
>>    "Whether CSS colors should be fontified using the color as the background.
>>  When non-`nil', a text representing CSS color will be fontified
>> @@ -1199,7 +1188,8 @@ css--fontify-region
>>  		    (add-text-properties
>>  		     start (point)
>>  		     (list 'face (list :background color
>> -				       :foreground (css--contrasty-color color)
>> +				       :foreground (readable-foreground-color
>> +                                                    color)
>>  				       :box '(:line-width -1))))))))))))
>>      extended-region))
>
> Here, once again I will ask what practical problem is being fixed.

I can't comment on the patch overall, but this part at least seems to
address Richard Copley's complaints in bug#30295. A dark foreground is
now used for #0f0/rgba(0,255,0,0.5) and #5e5 as Richard requested, which
indeed looks more readable to me too.

Maybe the pendulum has swung too far however. For instance, a dark
foreground is now used for #ef716e, which I think was easier to read
with the light foreground used before. Could that be fixed by tweaking
the cut-off values in color-dark-p, perhaps?

-- Simen





  reply	other threads:[~2020-06-07  9:04 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 16:29 bug#41544: 26.3; Possible incorrect results from color-distance Simon Pugnet
2020-05-28 17:31 ` Mattias Engdegård
2020-05-29 15:17   ` Mattias Engdegård
2020-05-29 15:36     ` Eli Zaretskii
2020-05-29 17:28       ` Mattias Engdegård
2020-05-29 17:52     ` Tom Tromey
2020-05-31 20:46       ` Mattias Engdegård
2020-06-01 16:32         ` Eli Zaretskii
2020-06-01 17:24           ` Mattias Engdegård
2020-06-01 17:35             ` Eli Zaretskii
2020-06-01 17:44               ` Eli Zaretskii
2020-06-02 15:27                 ` Mattias Engdegård
2020-06-02 16:14                   ` Eli Zaretskii
2020-06-02 20:41                     ` Mattias Engdegård
2020-06-03 14:24                       ` Eli Zaretskii
2020-06-03 15:01                         ` Mattias Engdegård
2020-06-03 15:59                           ` Eli Zaretskii
2020-06-03 20:08                             ` Mattias Engdegård
2020-06-04 14:07                               ` Eli Zaretskii
2020-06-04 15:29                                 ` Mattias Engdegård
2020-06-05 12:27                                   ` Eli Zaretskii
2020-06-05 15:50                                     ` Mattias Engdegård
2020-06-06  7:29                                       ` Eli Zaretskii
2020-06-06 10:59                                         ` Mattias Engdegård
2020-06-06 11:59                                           ` Eli Zaretskii
2020-06-06 13:29                                             ` Mattias Engdegård
2020-06-06 13:57                                               ` Eli Zaretskii
2020-06-06 16:54                                                 ` Mattias Engdegård
2020-06-06 18:15                                                   ` Drew Adams
2020-06-07  9:13                                                     ` Mattias Engdegård
2020-06-07 14:30                                                       ` Eli Zaretskii
2020-06-07 16:12                                                         ` Drew Adams
2020-06-09 12:19                                                         ` Mattias Engdegård
2020-06-07 16:00                                                       ` Drew Adams
2020-06-06 18:27                                                   ` Eli Zaretskii
2020-06-07  9:04                                                     ` Simen Heggestøyl [this message]
     [not found]                                                     ` <87pnabfdr5.fsf@simenheg@gmail.com>
2020-06-07 10:14                                                       ` Mattias Engdegård
2020-06-07 19:23                                                         ` Simen Heggestøyl
     [not found]                                                         ` <87d06ar87d.fsf@simenheg@gmail.com>
2020-06-07 19:27                                                           ` Mattias Engdegård
2020-06-08 18:39                                                             ` Simen Heggestøyl
2020-06-07 14:26                                                       ` Eli Zaretskii
2020-06-07 16:10                                                         ` Drew Adams
2020-06-07 19:26                                                         ` Simen Heggestøyl
2020-06-08 13:11                                                     ` Mattias Engdegård
2020-06-08 14:30                                                       ` Drew Adams
2020-06-08 19:53                                                         ` Mattias Engdegård
2020-06-10 18:37                                                           ` Drew Adams
2020-06-10 19:12                                                             ` Mattias Engdegård
2020-06-09 16:20                                                       ` Eli Zaretskii
2020-06-10 14:51                                                         ` Mattias Engdegård
2020-06-10 15:08                                                           ` Eli Zaretskii
2020-06-10 18:29                                                             ` Mattias Engdegård
2020-06-10 18:45                                                               ` Eli Zaretskii
2020-08-18 13:44                                                                 ` Lars Ingebrigtsen
2020-08-18 14:06                                                                   ` Eli Zaretskii
2020-08-18 14:10                                                                     ` Lars Ingebrigtsen
2020-08-18 14:19                                                                       ` Mattias Engdegård
2020-08-19 10:11                                                                         ` Lars Ingebrigtsen
2020-08-19 11:28                                                                           ` Mattias Engdegård
2020-08-19 11:34                                                                             ` Lars Ingebrigtsen
2020-08-18 14:51                                                                       ` Eli Zaretskii
2020-08-19 10:13                                                                         ` Lars Ingebrigtsen
2020-08-19 14:52                                                                           ` Eli Zaretskii
2020-08-19 15:03                                                                             ` Lars Ingebrigtsen
2020-08-19 17:15                                                                               ` Eli Zaretskii
2020-08-20 13:08                                                                                 ` Lars Ingebrigtsen
2020-08-21 11:32                                                                                   ` Mattias Engdegård
2020-08-22 13:22                                                                                     ` Lars Ingebrigtsen
2020-06-04  6:15                       ` Simon Pugnet
2020-06-04  8:57                         ` Mattias Engdegård
2020-06-01 19:46         ` Basil L. Contovounesios
2020-06-02 15:08           ` Mattias Engdegård

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='48285.0711954356$1591520716@news.gmane.org' \
    --to=simenheg@runbox.com \
    --cc=41544@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mattiase@acm.org \
    --cc=rcopley@gmail.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 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.