emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatic face setting based on contrast?


From: Simon Pugnet
Subject: Re: Automatic face setting based on contrast?
Date: Thu, 07 Oct 2021 13:52:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Tyler Grinn <tylergrinn@gmail.com> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> We discussed such things in the past and yes, it would be great.
>> There are various situations, one of them being to compute faces when
>> a theme is installed or when a face is defined, but there can also be
>> more dynamic cases where a face could adapt to the place where it's used
>> (i.e. the actual computation would be performed during redisplay).
>> Not sure if those two situations should be treated uniformly or if they
>> should be handled by different mechanisms.
>>
>>
>>         Stefan
>>
>>
>
> It seems to me that there will always be a choice to be made, or a range
> of acceptable colors for contrast.  Maybe a less opinionated way to go
> about this would be to limit the color picker in the customize face
> buffer to accessible colors and show a warning for faces that are not
> sufficiently contrasting.
>
> One way to implement that would be to write a command to analyze all
> faces in the current buffer.  That way, a theme author could enable a
> major mode and see a list of all faces and an accessibility report.

I remember reporting a bug with the color_distance function in xfaces.c
and as I remember that led to a detailed and interesting discussion
about how to calculate accurate colour distances. Here's the link to the
thread in case it's useful:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41544

Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]