[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: VOTE: Changing completions-common-part face's default
From: |
Yuri Khan |
Subject: |
Re: VOTE: Changing completions-common-part face's default |
Date: |
Thu, 7 Nov 2019 21:41:41 +0700 |
On Thu, 7 Nov 2019 at 20:53, João Távora <address@hidden> wrote:
> This points to a rule for finding the perfect good compromise:
> find the color equidistant to both black and white that passes
> both tests.
Because of the way contrast ratio is defined:
R = (L_lighter + 0.05) / (L_darker + 0.05)
if we require R(color, black) ≥ 4.5 and R(color, white) ≥ 4.5, we get:
(L(white) + 0.05) / (L(color) + 0.05) ≥ 4.5
1.05 / (L(color) + 0.05) ≥ 4.5
1.05 / 4.5 ≥ L(color) + 0.05
0.183333 ≥ L(color)
and:
(L(color) + 0.05) / (L(black) + 0.05) ≥ 4.5
(L(color) + 0.05) / 0.05 ≥ 4.5
L(color) + 0.05 ≥ 4.5 * 0.05 = 0.225
L(color) ≥ 0.175
So the set of colors that satisfy the 4.5:1 contrast criterion against
both white and black is a very thin surface of colors with relative
luminance between 0.175 and 0.183. Basically:
greens #008800 to #008a00
cyans #008282 to #008484
blues (somewhat tinted) #5e5eff to #6161ff
magentas #ce00ce to #d100d1
reds #eb0000 to #ee0000
yellows (rather, olives) #797900 to #7a7a00
grays #757575 to #767676
and various intermediates.
If you also want to account for the uncustomized 256-color xterm
palette, then I think it comes down to a single gray and maybe a
handful of cube colors. (Most non-black colors of that palette are
optimized for contrast against black background.)
However, the 4.5:1 threshold is tuned for readability of text on
background, not distinguishability of two text colors. For
distinguishability, maybe 3:1 or even lower would be enough.
- Re: VOTE: Changing completions-common-part face's default, (continued)
- Re: VOTE: Changing completions-common-part face's default, Dmitry Gutov, 2019/11/06
- Re: VOTE: Changing completions-common-part face's default, João Távora, 2019/11/06
- Re: VOTE: Changing completions-common-part face's default, Dmitry Gutov, 2019/11/06
- Re: VOTE: Changing completions-common-part face's default, João Távora, 2019/11/06
- Re: VOTE: Changing completions-common-part face's default, Dmitry Gutov, 2019/11/06
- Re: VOTE: Changing completions-common-part face's default, Stefan Monnier, 2019/11/06
- Re: VOTE: Changing completions-common-part face's default, Dmitry Gutov, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, João Távora, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, Yuri Khan, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, João Távora, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default,
Yuri Khan <=
- Re: VOTE: Changing completions-common-part face's default, João Távora, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, Stefan Monnier, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, João Távora, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, Dmitry Gutov, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, João Távora, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, Dmitry Gutov, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, João Távora, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, Dmitry Gutov, 2019/11/07
- Re: VOTE: Changing completions-common-part face's default, João Távora, 2019/11/07
- RE: VOTE: Changing completions-common-part face's default, Drew Adams, 2019/11/07