* Re: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-12 15:50 ` Mattias Engdegård
@ 2020-06-12 16:22 ` tomas
2020-06-12 18:36 ` Yuri Khan
` (3 subsequent siblings)
4 siblings, 0 replies; 20+ messages in thread
From: tomas @ 2020-06-12 16:22 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]
On Fri, Jun 12, 2020 at 05:50:32PM +0200, Mattias Engdegård wrote:
> 11 juni 2020 kl. 21.22 skrev Yuri Khan <yuri.v.khan@gmail.com>:
>
> > My equipment [...] says that shade of gold in fact
> > performs okay in all four scenarios
>
> I have no reason to doubt your observations. Let's try a plebiscite!
>
> * * *
>
> Dear Emacs developer or user,
>
> Please load the attached code (any Emacs version), and run M-x contrast-compare with various cutoff values on your favourite system, to find what value is best for readability of the colour names (first column).
>
> Colours with luminance (last column) below the cutoff will be use white text, others black. It is mainly Emacs in graphical (non-TTY) mode that is of interest.
>
> Please reply (to emacs-devel or to me) the following pieces of information:
>
> * the cutoff value you found optimal
You mean: where the color name is most readable against all
backgrounds? 0.375 (although 0.325 gives fine results too)
> * system information: window system, screen, anything you think is relevant
X on Gnu/Linux, thinkpad X230 with the cheaper screen (no IPS)
> * whether you use a light or dark background in your Emacs
Dark Emacs (but not too dark, #333333-ish)
Cheers
-- tomás
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-12 15:50 ` Mattias Engdegård
2020-06-12 16:22 ` tomas
@ 2020-06-12 18:36 ` Yuri Khan
2020-06-13 10:55 ` Mattias Engdegård
2020-06-12 19:02 ` Drew Adams
` (2 subsequent siblings)
4 siblings, 1 reply; 20+ messages in thread
From: Yuri Khan @ 2020-06-12 18:36 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: Stefan Monnier, Emacs developers
On Fri, 12 Jun 2020 at 22:50, Mattias Engdegård <mattiase@acm.org> wrote:
> Please load the attached code (any Emacs version), and run M-x contrast-compare with various cutoff values on your favourite system, to find what value is best for readability of the colour names (first column).
> Please reply (to emacs-devel or to me) the following pieces of information:
>
> * the cutoff value you found optimal
> * system information: window system, screen, anything you think is relevant
> * whether you use a light or dark background in your Emacs
Despite science calling for .18, I find that my subjective optimal
cutoff is somewhere between .25 and .31, even if I change the formulae
to more accurately model the piecewise gamma correction of sRGB:
- (r (expt (nth 0 rgb) 2.2))
+ (R (nth 0 rgb))
+ (r (if (<= R 0.03928)
+ (/ R 12.92)
+ (expt (/ (+ R 0.055) 1.055) 2.4)))
(same for g and b.)
I am on GTK+3/X11, Dell P2415Q (HiDPI IPS), RGB-subpixel slight-hinted
Cousine font at 10.5pt, on overall dark gray background (#414042).
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-12 18:36 ` Yuri Khan
@ 2020-06-13 10:55 ` Mattias Engdegård
0 siblings, 0 replies; 20+ messages in thread
From: Mattias Engdegård @ 2020-06-13 10:55 UTC (permalink / raw)
To: Yuri Khan; +Cc: Stefan Monnier, Emacs developers
12 juni 2020 kl. 20.36 skrev Yuri Khan <yuri.v.khan@gmail.com>:
> Despite science calling for .18, I find that my subjective optimal
> cutoff is somewhere between .25 and .31, even if I change the formulae
> to more accurately model the piecewise gamma correction of sRGB:
Thanks for the report, and yes, I did test with the exact sRGB gamma curve and noticed almost no significant differences.
The only differences in the standard colour table are: #999999 (grey60), #ee7600 (darkorange2), #ee7621 (chocolate2) and #bc8f8f (rosybrown), all categorised as 'light' with power 2.2 and 'dark' with the exact sRGB gamma function, assuming a cutoff of 0.325. It's really hard to say which one is right.
^ permalink raw reply [flat|nested] 20+ messages in thread
* RE: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-12 15:50 ` Mattias Engdegård
2020-06-12 16:22 ` tomas
2020-06-12 18:36 ` Yuri Khan
@ 2020-06-12 19:02 ` Drew Adams
2020-06-12 19:09 ` Stephen Leake
2020-06-13 4:05 ` Richard Stallman
4 siblings, 0 replies; 20+ messages in thread
From: Drew Adams @ 2020-06-12 19:02 UTC (permalink / raw)
To: Mattias Engdegård, Yuri Khan; +Cc: Stefan Monnier, Emacs developers
[-- Attachment #1: Type: text/plain, Size: 1635 bytes --]
> Please load the attached code (any Emacs version), and run M-x contrast-
> compare with various cutoff values on your favourite system, to find what
> value is best for readability of the colour names (first column).
>
> Colours with luminance (last column) below the cutoff will be use white text,
> others black. It is mainly Emacs in graphical (non-TTY) mode that is of
> interest.
>
> Please reply (to emacs-devel or to me) the following pieces of information:
>
> * the cutoff value you found optimal
> * system information: window system, screen, anything you think is relevant
> * whether you use a light or dark background in your Emacs
Emacs 26.3, MS Windows 10, fairly old Dell monitor.
With emacs -Q, so light background:
Cutoff 0.325 (default) is OK.
.2, .4, .5, and .6 are all OK.
To me, showing the same color in both black & white,
next to each other, was the most helpful for deciding.
I looked mostly at the grays, and looked at their hex
codes, which are shown in both black & white.
Based on that, I'd say that that gray60 is about the
crossover point: black or white foreground are equally
readable for gray60 and immediate neighbors. And that
corresponds to your default cutoff of about 0.325.
See attached screenshot.
Around that area, white text was generally more
visible/noticeable, but it was less _readable_.
But it makes no difference, with that comparison,
whether the frame background is light or dark. Why?
because the areas to be compared provide their own
background - the frame background is seen only with
the rightmost (decimal-number) field.
[-- Attachment #2: throw-color-contrast-grays.png --]
[-- Type: image/png, Size: 18573 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-12 15:50 ` Mattias Engdegård
` (2 preceding siblings ...)
2020-06-12 19:02 ` Drew Adams
@ 2020-06-12 19:09 ` Stephen Leake
2020-06-18 19:28 ` Mattias Engdegård
2020-06-13 4:05 ` Richard Stallman
4 siblings, 1 reply; 20+ messages in thread
From: Stephen Leake @ 2020-06-12 19:09 UTC (permalink / raw)
To: emacs-devel
Mattias Engdegård <mattiase@acm.org> writes:
> * the cutoff value you found optimal
0.325 works for me; I found it hard to see any difference between 0.2
and 0.5 (some colors did switch from light to dark foreground, but they
were equally readable. I did not spend much time studying all the colors.
> * system information: window system, screen, anything you think is
> relevant
Windows 8, LG IPS LED display, 2560 x 1440, 27 inch diagonal
> * whether you use a light or dark background in your Emacs
(:background "light goldenrod yellow" :foreground "black")
--
-- Stephe
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-12 19:09 ` Stephen Leake
@ 2020-06-18 19:28 ` Mattias Engdegård
2020-06-18 19:35 ` Drew Adams
2020-06-18 19:40 ` Basil L. Contovounesios
0 siblings, 2 replies; 20+ messages in thread
From: Mattias Engdegård @ 2020-06-18 19:28 UTC (permalink / raw)
To: Stephen Leake, Yuri Khan, Drew Adams, tomas; +Cc: emacs-devel
Thanks to those who replied -- the originally proposed 0.325 luminance limit seems to be fairly uncontroversial and can be changed if evidence indicates that it was badly chosen. Most of all, the value seems to work well across all platforms and a sufficient variety of equipment, which is the important part.
Special thanks to Yuri for helping me confirm that the theoretical 50% lightness of luminance 0.18 wasn't necessarily an optimal value in this case. Trust my own eyes, but verify!
The constant has now been given a (provisional) name, for extra clarity and ease of adjustment.
^ permalink raw reply [flat|nested] 20+ messages in thread
* RE: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-18 19:28 ` Mattias Engdegård
@ 2020-06-18 19:35 ` Drew Adams
2020-06-18 20:04 ` Mattias Engdegård
2020-06-18 19:40 ` Basil L. Contovounesios
1 sibling, 1 reply; 20+ messages in thread
From: Drew Adams @ 2020-06-18 19:35 UTC (permalink / raw)
To: Mattias Engdegård, Stephen Leake, Yuri Khan, tomas; +Cc: emacs-devel
> Thanks to those who replied -- the originally proposed 0.325 luminance limit
> seems to be fairly uncontroversial and can be changed if evidence indicates
> that it was badly chosen. Most of all, the value seems to work well across
> all platforms and a sufficient variety of equipment, which is the important
> part.
>
> Special thanks to Yuri for helping me confirm that the theoretical 50%
> lightness of luminance 0.18 wasn't necessarily an optimal value in this case.
> Trust my own eyes, but verify!
>
> The constant has now been given a (provisional) name, for extra clarity and
> ease of adjustment.
Not to belabor this, and I don't recall all that's
involved.
But if there are different eyes, screens, whatever,
would it make sense to use a defvar, or even a defcustom,
instead of a defconst? Why decide this definitively
at design time? Does it make sense to hard-code it?
If the question isn't useful, please ignore.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-18 19:35 ` Drew Adams
@ 2020-06-18 20:04 ` Mattias Engdegård
2020-06-18 20:32 ` Drew Adams
0 siblings, 1 reply; 20+ messages in thread
From: Mattias Engdegård @ 2020-06-18 20:04 UTC (permalink / raw)
To: Drew Adams; +Cc: emacs-devel, tomas, Stephen Leake, Yuri Khan
18 juni 2020 kl. 21.35 skrev Drew Adams <drew.adams@oracle.com>:
> But if there are different eyes, screens, whatever,
> would it make sense to use a defvar, or even a defcustom,
> instead of a defconst? Why decide this definitively
> at design time? Does it make sense to hard-code it?
Well, it isn't really hard-coded in the sense that it cannot be changed later on, or be turned into a defcustom; both perfectly possible. However, I'd rather not get carried away and add yet another customisable variable before we have more substantial evidence that it would make sense to do so.
^ permalink raw reply [flat|nested] 20+ messages in thread
* RE: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-18 20:04 ` Mattias Engdegård
@ 2020-06-18 20:32 ` Drew Adams
2020-06-21 7:51 ` Mattias Engdegård
0 siblings, 1 reply; 20+ messages in thread
From: Drew Adams @ 2020-06-18 20:32 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: emacs-devel, tomas, Stephen Leake, Yuri Khan
> > But if there are different eyes, screens, whatever,
> > would it make sense to use a defvar, or even a defcustom,
> > instead of a defconst? Why decide this definitively
> > at design time? Does it make sense to hard-code it?
>
> Well, it isn't really hard-coded in the sense that it cannot be changed later
> on, or be turned into a defcustom; both perfectly possible. However, I'd
> rather not get carried away and add yet another customisable variable before
> we have more substantial evidence that it would make sense to do so.
A defvar would be fine. defconst explicitly signals
the intention that neither users nor code should
change the value. That's the wrong signal, I think.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-18 20:32 ` Drew Adams
@ 2020-06-21 7:51 ` Mattias Engdegård
0 siblings, 0 replies; 20+ messages in thread
From: Mattias Engdegård @ 2020-06-21 7:51 UTC (permalink / raw)
To: Drew Adams; +Cc: Yuri Khan, tomas, Stephen Leake, emacs-devel
18 juni 2020 kl. 22.32 skrev Drew Adams <drew.adams@oracle.com>:
> A defvar would be fine. defconst explicitly signals
> the intention that neither users nor code should
> change the value. That's the wrong signal, I think.
We'll have to disagree then -- the amount isn't changed programmatically and not intended to be changed by the user any more than any numeric literal inside a function. Again, this can be changed if it turns out to be useful.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-18 19:28 ` Mattias Engdegård
2020-06-18 19:35 ` Drew Adams
@ 2020-06-18 19:40 ` Basil L. Contovounesios
2020-06-18 19:58 ` Mattias Engdegård
1 sibling, 1 reply; 20+ messages in thread
From: Basil L. Contovounesios @ 2020-06-18 19:40 UTC (permalink / raw)
To: Mattias Engdegård
Cc: emacs-devel, tomas, Stephen Leake, Drew Adams, Yuri Khan
Mattias Engdegård <mattiase@acm.org> writes:
> Thanks to those who replied -- the originally proposed 0.325 luminance limit
> seems to be fairly uncontroversial and can be changed if evidence indicates that
> it was badly chosen. Most of all, the value seems to work well across all
> platforms and a sufficient variety of equipment, which is the important part.
>
> Special thanks to Yuri for helping me confirm that the theoretical 50% lightness
> of luminance 0.18 wasn't necessarily an optimal value in this case. Trust my own
> eyes, but verify!
>
> The constant has now been given a (provisional) name, for extra clarity and ease of adjustment.
Thanks! Could the constant's docstring please follow the convention
described under (info "(elisp) Documentation Tips") of keeping the first
sentence on a single line?
--
Basil
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: master 68ae6fa: Improved light/dark colour predicate (bug#41544)
2020-06-12 15:50 ` Mattias Engdegård
` (3 preceding siblings ...)
2020-06-12 19:09 ` Stephen Leake
@ 2020-06-13 4:05 ` Richard Stallman
4 siblings, 0 replies; 20+ messages in thread
From: Richard Stallman @ 2020-06-13 4:05 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: emacs-devel, monnier, yuri.v.khan
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
A "plebiscite" means counting votes. That is not a good way to decide
which features to include.
You have asked people to give important information about what works
well or badly for each of them. That is a useful thing to do, because
using their responses it may be possible to figure out a solution that
works ok for all users, or nearly all users.
It may also be possible to figure out a good rule for choosing between
one behavior and another. That could work well for everyone.
--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
^ permalink raw reply [flat|nested] 20+ messages in thread