From: Drew Adams <drew.adams@oracle.com>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: 41544@debbugs.gnu.org
Subject: bug#41544: 26.3; Possible incorrect results from color-distance
Date: Sun, 7 Jun 2020 09:00:34 -0700 (PDT) [thread overview]
Message-ID: <93fdabf1-f725-4e8c-a9de-8e4c61ff7973@default> (raw)
In-Reply-To: <5AEB442C-5592-46E4-BC38-185BA9D2D956@acm.org>
> > +(defun color-dark-p (rgb)
> > + "Whether RGB is more readable against white than black.
> > +RGB is a 3-element list (R G B), each component in the range [0,1]."
>
> > The predicate name suggests it's about testing a
> > color (via RGB) to determine whether it's dark or
> > light.
> >
> > The doc string suggests it's specifically about
> > the readability of _foreground_ text that is of
> > that color - specifically whether it's more
> > readable against a white than a black background.
>
> Thank you, this actually raises a good point.
>
> The predicate should work with the argument both as a foreground and as a
> background colour, for selecting a black or white contrasting colour. The
> assumption is that the same predicate can be used for both, which may be
> wrong, but absent evidence to the contrary, I think it is a reasonable one to
> make.
>
> If you are in doubt, see if you can come up with a colour for which it does
> not hold. For example, if you find a rare shade of beige that when used for
> text looks better against a white background, but when used as a background
> prefers black text. I have yet to do so, much less been able to articulate it
> formally as an algorithm.
>
> I agree that this could be stated more explicitly in the doc string.
1. Please do consider stating the behavior more explicitly
in the doc.
2. I don't have any special knowledge or suggestion about
whether the same criteria should be used for light and dark
foreground/background. I'd think that the comparison would
need to use the complement of the foreground or background,
a priori. E.g. if a background is 90% light then what
works as a "readable" dark foreground would lead to a light
foreground that is more or less similarly "readable" when
against a 90% dark background.
___
In my own work, when I supply a default foreground or
background for a face, I typically do this:
I start with a light background (my own setup uses LightBlue
- somewhat light), and I pick a color that seems reasonable
enough for the foreground default - by eyeball. Then I
check it against the default (emacs -Q) background - again,
by eyeball.
Once I've picked a default foreground color for a light
`background-mode', I take its complement (using `hexrgb.el')
as the default foreground for a dark background. I check
that with emacs -Q. (I use a light background in my setup,
and I don't spend a lot of energy trying to get a great
default for a dark background.)
In my experience (feedback from users), complementing works
pretty well. And since, in my setup, I use a background
that's only somewhat light, it gives a pretty good idea of
what works (according to my eyes) for a complemented
(hence somewhat dark) background.
No idea whether any of this info helps you, but it's
what I do. I don't use color-distance in this endeavor.
next prev parent reply other threads:[~2020-06-07 16:00 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 [this message]
2020-06-06 18:27 ` Eli Zaretskii
2020-06-07 9:04 ` Simen Heggestøyl
[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=93fdabf1-f725-4e8c-a9de-8e4c61ff7973@default \
--to=drew.adams@oracle.com \
--cc=41544@debbugs.gnu.org \
--cc=mattiase@acm.org \
/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.