unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Eli Zaretskii" <eliz@is.elta.co.il>
Cc: emacs-devel@gnu.org
Subject: Re: terminal capability querying
Date: Sat, 20 Apr 2002 12:31:15 +0300	[thread overview]
Message-ID: <3776-Sat20Apr2002123114+0300-eliz@is.elta.co.il> (raw)
In-Reply-To: <873cxqrdo5.fsf@tc-1-100.kawasaki.gol.ne.jp> (message from Miles Bader on 20 Apr 2002 17:12:58 +0900)

> From: Miles Bader <miles@gnu.org>
> 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	other threads:[~2002-04-20  9:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-20  2:20 terminal capability querying Miles Bader
2002-04-20  7:08 ` Eli Zaretskii
2002-04-20  8:12   ` Miles Bader
2002-04-20  9:31     ` Eli Zaretskii [this message]
2002-04-20  9:58       ` Miles Bader
2002-04-20 11:46         ` Eli Zaretskii
2002-04-21 20:02 ` Richard Stallman
2002-04-22  0:20   ` Miles Bader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3776-Sat20Apr2002123114+0300-eliz@is.elta.co.il \
    --to=eliz@is.elta.co.il \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).