emacs-devel
[Top][All Lists]
Advanced

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

Re: Why min-colors 88?


From: Eli Zaretskii
Subject: Re: Why min-colors 88?
Date: Sat, 04 Feb 2006 13:11:40 +0200

> Date: Fri, 03 Feb 2006 11:50:46 -0800
> From: Bill Wohler <address@hidden>
> 
> Can anyone explain the magic number 88 to me? Why is this used throughout 
> Emacs?
> Why is this the default generated when customizing a face (on devices
> with lots of colors)?

Because there's an 88-color xterm whose color set is rich enough to
support all the colors we use in Emacs' faces.

> I'd understand 16 (larger than the number of colors in the console and
> the number of names defined by W3C HTML 4.0), 216 ("web-safe" or 256-40
> colors reserved by the OS), and 256.

We found that 256/216 colors are indistinguishable from 88,
practically speaking.

> An MH-E developer has a device where (device-color-cells) returns 64.

Out of curiosity, what device is that?

In any case, there's no support in Emacs for such devices right now,
i.e. there's no 64-color set that can be used to map the face colors
using the tty-colors.el machinery.  So I wonder how does that
developer use his/her device with Emacs.

> What harm could there be in changing our specifications to use 64
> instead of 88?

I don't know.  To find out, someone will have to:

  . find out what colors, in terms of RGB values, are defined on that
    device
  . map the colors used by Emacs (e.g. in color-name-rgb-alist) into
    those 64 colors, using tty-color-translate
  . see how many Emacs colors map to the same color on the 64-color
    deives, and
  . draw the conclusions.

> Finally, why are there a lot of faces with seemingly redundant
> specifications such as this?
> 
>   (defface highlight
>     '((((class color) (min-colors 88) (background light))
>        :background "darkseagreen2")
>       (((class color) (min-colors 88) (background dark))
>        :background "darkolivegreen")
>       (((class color) (min-colors 16) (background light))
>        :background "darkseagreen2")
>       (((class color) (min-colors 16) (background dark))
>        :background "darkolivegreen")
>       (((class color) (min-colors 8))
>        :background "green" :foreground "black")
>       (t :inverse-video t))
>     "Basic face for highlighting."
>     :group 'basic-faces)

The main reason is to allow an easy modification of the defaults for
88-and-up color terminals in the future.  The 88-color support is new
with Emacs 22, so for now, we just duplicated the old definitions.  We
expect them to change as user experience is gained when Emacs 22 is
released.




reply via email to

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