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: Tyler Grinn
Subject: Re: Automatic face setting based on contrast?
Date: Thu, 07 Oct 2021 08:32:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Currently, a face can inherit properties from another face.
>> Could there be a kind of contrast-inheritance where face A
>> is set automatically to contrast strongly with B, and contrast
>> somewhat with C and D?  Based on calculations on the RGB codes,
>> I imagine.
>
> 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.

-- 

Best,

Tyler



reply via email to

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