[Top][All Lists]

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

Re: terminal capability querying

From: Eli Zaretskii
Subject: Re: terminal capability querying
Date: Sat, 20 Apr 2002 12:31:15 +0300

> From: Miles Bader <address@hidden>
> Date: 20 Apr 2002 17:12:58 +0900
>    If the user queries about, say, (:background "springgreen"), for
>    low-color displays such as ttys, it could search through the list of
>    colors, see if there's a displayable background color that's within
>    some epsilon, and return false if there's not.  [You're the tty-color
>    expert here, so perhaps you have some ideas here.]

Testing colors for how close they are is relatively easy.  In fact
tty-colors.el already implements two such measures; they might need
some simple generalizations, though.

>    (:weight bold
>     :foreground "black"
>     [(:background "springgreen")
>      (:background "cyan")
>      (:background "grey70")])
> which would then use a `springgreen' background for displays that
> support it reasonably well, like X displays or 256-color ttys, and fall
> back to (presumably) safer alternative `cyan' for low-color displays,
> or `grey70' for greyscale displays [and the lattern should degrade to
> simply `white' for black-and-white displays].  No #-of-colors tests,
> but nice, flexible behavior on lots of display types!

This will work well if we assume that color choices for foreground and
background are independent.  I suspect that it's not always so.  In
those cases where there's a dependency between the two colors, I think
we had better keep that dependency explicit in defface in some way
(although doing that via the number of supported colors is not the
only possible way).

The reason that foreground and background color selection might not be
independent is that for terminals that support a low number of colors,
simply peeking up the best approximation to the original X color might
produce unpleasant results.  So sometimes your vector of alternative
colors will have to specify a totally different foreground color for
low-end displays, and thus require a suitably different background
color.  The recent changes I did to Ediff colors is one case in point.

reply via email to

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