[Top][All Lists]

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

Re: About the :distant-foreground face attribute

From: Eli Zaretskii
Subject: Re: About the :distant-foreground face attribute
Date: Wed, 08 Jan 2014 19:43:57 +0200

> From: Chong Yidong <address@hidden>
> Cc: address@hidden,  address@hidden
> Date: Wed, 08 Jan 2014 13:24:17 +0800
> Eli Zaretskii <address@hidden> writes:
> >> The feature does not fit well with the design of the rest of the
> >> face-handling code.  We already have a mechanism for checking to see
> >> when to use a particular face: the DISPLAY element in a face spec.  The
> >> :distant-foreground face attribute, by its very existence, is redundant
> >> with what the DISPLAY element was meant to do.  This adds extra
> >> complexity to the design, for no good reason.
> >
> > I don't understand this criticism.  How is this attribute different
> > from min-colors?
> The min-colors feature doesn't involve adding an extra face attribute.

This is an implementation detail, while your criticism above seems to
be about the design.

> The analogy would be if there was a :low-color-foreground face attribute
> which would override :foreground on low-color displays.  That would be
> ugly, as I hope you agree.

I'm not sure I see the ugliness, please elaborate.

> Change the feature so it applies to all faces, but in a configurable
> way.  Introduce a new Lisp variable, `face-minimum-contrast', which
> specifies the minimum allowed contrast between the background and
> foreground of any face (or nil, which means to disable the feature).  If
> the contrast of a face is lower than specified, the foreground color is
> adjusted (say, by changing its V component) to conform to the minimum
> contrast.

I don't think it will be a good idea to have a single global setting,
because this would preclude a Lisp program from defining a face that
will always use the specified foreground, no matter what.  E.g., I
could imagine an application that would like to make the text
invisible by specifying the same fore- and background colors.  While
probably rare, such use cases are entirely legitimate, I think.

So I think we need this to be specified on the level of individual

reply via email to

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