Dear Christopher.

In order to propose a useful fix, I did do metrics to get a better contrast.

I made a code to compute the luminance L of all colors in AUCTeX.

The luminance of a color named COLOR-NAME can be computed natively as
(nth 2 (apply 'color-rgb-to-hsl
                   (color-name-to-rgb COLOR-NAME)))

The worst case scenario is when theme authors choose background color in
mid tones (background luminance around 0.5).

To detect poor contrast, in light background, foreground color should have
luminance < 0.4, and in dark background, luminance > 0.6. So the metric was
at least 0.1 for the worst scenario, but a wise choice for themes is not
such a worst case scenario ;-)

Once I detected the bad colors, I chose similar colors (mostly with similar
names) as replacement, to keep changes as little as possible, for
historical reasons.

PS.: By the way, I also use the tsdh-dark-theme. Before, I barely could see
math scripts ^ and _ in that theme.

Miguel.


Em qui., 8 de ago. de 2024 às 16:04, Christopher Dimech <dim...@gmx.com>
escreveu:

> > Sent: Friday, August 09, 2024 at 6:48 AM
> > From: "Arash Esbati" <ar...@gnu.org>
> > To: "Christopher Dimech" <dim...@gmx.com>
> > Cc: "Miguel V. S. Frasson" <mvsfras...@gmail.com>, "Tassilo Horn" <
> t...@gnu.org>, auctex-devel@gnu.org
> > Subject: Re: Some font faces have poor contrast
> >
> > Christopher Dimech <dim...@gmx.com> writes:
> >
> > > Did you apply the contrast ratio metric to reach good standard for
> > > visibility ?
> >
> > The metric we used was "before vs. after" which you can see here:
> >
> >   https://lists.gnu.org/archive/html/auctex-devel/2024-07/msg00076.html
> >
> > Best, Arash
>
> You did not use any metric.  Metrics require calculation of numerical
> measures.
> What looks good to you might not look good enough to others.
>
> Introspect this
>
> https://www.24a11y.com/2019/color-theory-and-contrast-ratios/
>
>

-- 
Miguel Vinicius Santini Frasson
mvsfras...@gmail.com

Reply via email to