unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* face colors on 256 colors terminals
@ 2005-04-06  8:17 Dan Nicolaescu
  2005-04-06 17:23 ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Dan Nicolaescu @ 2005-04-06  8:17 UTC (permalink / raw)



On a 256 color terminal emacs faces should use very similar colors to
the ones used on X11. It turns out that the color used are a bit
lighter. 
Here's a screenshot of a modified M-x list-faces-display: 
http://www.ics.uci.edu/~dann/col.jpg
(the frame on the left is an xterm, the one on the left is X11)

Running the  function below  on a 256 color terminal shows that there
are some problems mapping the gray0->gray100 colors, they are not
mapped to linearly lighter shades of gray. Also the colors that have 2
of the RGB values 0 and the third 255 (red1, blue1, green1) are not
mapped correctly.

(defun my-list-colors-display (&optional list)
  "Modified `list-colors-display'."
  (interactive)
  (when (and (null list) (> (display-color-cells) 0))
    (setq list (mapcar 'car color-name-rgb-alist))
    (when (memq (display-visual-class) '(gray-scale pseudo-color direct-color))
      ;; Don't show more than what the display can handle.
      (let ((lc (nthcdr (1- (display-color-cells)) list)))
	(if lc
	    (setcdr lc nil)))))
  (with-output-to-temp-buffer "*MYColors*"
    (save-excursion
      (set-buffer standard-output)
      (let (s)
	(while list
	  (setq s (point))
	  (insert (car list))
	  (indent-to 20)
	  (put-text-property s (point) 'face
			     (cons 'background-color (car list)))
	  (setq s (point))
	  (insert "  " (car list) 
		  (if  window-system "" 
		    (concat " ("(car  (tty-color-desc (car list))) ")") ) "\n")
	  (put-text-property s (point) 'face
			     (cons 'foreground-color (car list)))
	  (setq list (cdr list)))))))


I don't know if the code that maps the colors in
`color-name-rgb-alist' to terminal colors is correct, but I think
there are issues elsewhere in the code. 

First the values in term/xterm.el:xterm-standard-colors need updating,
this patch uses the values found in xterm-200 (the latest version):

*** xterm.el     26 Mar 2005 14:01:35 -0800             1.10
--- xterm.el     05 Apr 2005 22:56:14 -0700             
***************
*** 107,121 ****
      ("red"            1 (205   0   0))        ; red3
      ("green"          2 (  0 205   0))        ; green3
      ("yellow"         3 (205 205   0))        ; yellow3
!     ("blue"           4 (  0   0 205))        ; blue3
      ("magenta"        5 (205   0 205))        ; magenta3
      ("cyan"           6 (  0 205 205))        ; cyan3
      ("white"          7 (229 229 229))        ; gray90
!     ("brightblack"    8 ( 77  77  77))        ; gray30
      ("brightred"      9 (255   0   0))        ; red
      ("brightgreen"   10 (  0 255   0))        ; green
      ("brightyellow"  11 (255 255   0))        ; yellow
!     ("brightblue"    12 (  0   0 255))        ; blue
      ("brightmagenta" 13 (255   0 255))        ; magenta
      ("brightcyan"    14 (  0 255 255))        ; cyan
      ("brightwhite"   15 (255 255 255)))       ; white
--- 107,121 ----
      ("red"            1 (205   0   0))        ; red3
      ("green"          2 (  0 205   0))        ; green3
      ("yellow"         3 (205 205   0))        ; yellow3
!     ("blue"           4 (  0   0 238))        ; blue2
      ("magenta"        5 (205   0 205))        ; magenta3
      ("cyan"           6 (  0 205 205))        ; cyan3
      ("white"          7 (229 229 229))        ; gray90
!     ("brightblack"    8 (127 127 127))        ; gray50
      ("brightred"      9 (255   0   0))        ; red
      ("brightgreen"   10 (  0 255   0))        ; green
      ("brightyellow"  11 (255 255   0))        ; yellow
!     ("brightblue"    12 (92   92 255))        ; rgb:5c/5c/ff
      ("brightmagenta" 13 (255   0 255))        ; magenta
      ("brightcyan"    14 (  0 255 255))        ; cyan
      ("brightwhite"   15 (255 255 255)))       ; white


This comment in tty-colors.el:tty-color-standard-values 

         ;; Translate the string "#XXYYZZ" into a list
         ;; of numbers (XX YY ZZ).  If the primary colors
         ;; are specified with less than 4 hex digits,
         ;; the used digits represent the most significant
         ;; bits of the value (e.g. #XYZ = #X000Y000Z000).

does not seem to match the way the `color-name-rgb-alist' seem to have
been created from the values in rgb.txt. 
A random example:
>From color-name-rgb-alist:
    ("lavenderblush"    65535   61680   62965)
                        ^^^^    ^^^^    ^^^^
                        0xffff  0xf0f0  0xf5f5      

>From rgb.txt: lavender blush     255   240   245
                                 0xff  0xf0  0xf5
So the 8 to 16 bit conversion seems use the same byte value for both
the high and low byte value. 
To make the code in tty-colors.el consistent with this observation
something like this could be done: 

*** tty-colors.el	20 Aug 2004 14:28:41 -0700	1.14
--- tty-colors.el	06 Apr 2005 00:17:47 -0700	
***************
*** 931,945 ****
  		  (i2 (+ i1 ndig))
  		  (i3 (+ i2 ndig)))
  	     (list
! 	      (lsh
! 	       (string-to-number (substring color i1 i2) 16)
! 	       (* 4 (- 4 ndig)))
! 	      (lsh
  	       (string-to-number (substring color i2 i3) 16)
! 	       (* 4 (- 4 ndig)))
! 	      (lsh
  	       (string-to-number (substring color i3) 16)
! 	       (* 4 (- 4 ndig))))))
  	  ((and (>= len 9) ;; X-style RGB:xx/yy/zz color spec
  		(string= (substring color 0 4) "rgb:"))
  	   ;; Translate the string "RGB:XX/YY/ZZ" into a list
--- 931,950 ----
  		  (i2 (+ i1 ndig))
  		  (i3 (+ i2 ndig)))
  	     (list
! 	      (logior (lsh
! 		       (string-to-number (substring color i1 i2) 16)
! 		       (* 4 (- 4 ndig)))
! 		      (string-to-number (substring color i1 i2) 16))
! 	      (logior 
  	       (string-to-number (substring color i2 i3) 16)
! 	       (lsh
! 	       (string-to-number (substring color i2 i3) 16)
! 	       (* 4 (- 4 ndig))))
! 	      (logior 
! 	       (string-to-number (substring color i3) 16)
! 	       (lsh
  	       (string-to-number (substring color i3) 16)
! 	       (* 4 (- 4 ndig)))))))
  	  ((and (>= len 9) ;; X-style RGB:xx/yy/zz color spec
  		(string= (substring color 0 4) "rgb:"))
  	   ;; Translate the string "RGB:XX/YY/ZZ" into a list

The formulas used to compute the 16bit RGB values for the different
terminal colors don't match anymore what is found in 256colres.pl file
from xterm-200.

Here is a possible fix (only for 256 colors terminals): 

*** xterm.el	26 Mar 2005 14:01:35 -0800	1.10
--- xterm.el	06 Apr 2005 00:11:06 -0700	
*** 123,129 ****
  
  (defun xterm-rgb-convert-to-16bit (prim)
    "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
!   (min 65535 (round (* (/ prim 255.0) 65535.0))))
  
  (defun xterm-register-default-colors ()
    "Register the default set of colors for xterm or compatible emulator.
--- 123,129 ----
  
  (defun xterm-rgb-convert-to-16bit (prim)
    "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
!   (logior prim (lsh prim 8)))
  
  (defun xterm-register-default-colors ()
    "Register the default set of colors for xterm or compatible emulator.
***************
*** 160,168 ****
  	    (tty-color-define (format "color-%d" (- 256 ncolors))
  			      (- 256 ncolors)
  			      (mapcar 'xterm-rgb-convert-to-16bit
! 				      (list (round (* r 42.5))
! 					    (round (* g 42.5))
! 					    (round (* b 42.5)))))
  	    (setq b (1+ b))
  	    (if (> b 5)
  		(setq g (1+ g)
--- 160,169 ----
  	    (tty-color-define (format "color-%d" (- 256 ncolors))
  			      (- 256 ncolors)
  			      (mapcar 'xterm-rgb-convert-to-16bit
! 				      (list (if (zerop r) 0 (+ (* r 40) 55))
! 					    (if (zerop g) 0 (+ (* g 40) 55))
! 					    (if (zerop b) 0 (+ (* b 40) 55)))))
! 
  	    (setq b (1+ b))
  	    (if (> b 5)
  		(setq g (1+ g)


With this fixes the gray colors are mapped linearly, and so are the
red1, blue1 and green1 colors (I checked the pixels in a screenshot).

Some standard face definitions use colors like "red" or "blue". They 
should be changed "red1" (or "blue1") because on X11 "red" is 255/0/0,
but in an xterm is 205/0/0. "red1" will be mapped correctly on both
X11 and an xterm. 

Here is a screenshot after these patches:
http://www.ics.uci.edu/~dann/col-after.jpg

It can be seen that the colors used for the standard faces seem a bit
less different between the 2 emacs frames (one X11 and one running in
and xterm).

If anyone has more insights about this, please share them.

Thanks!

                --dan

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-06  8:17 face colors on 256 colors terminals Dan Nicolaescu
@ 2005-04-06 17:23 ` Eli Zaretskii
  2005-04-06 17:36   ` David Kastrup
                     ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Eli Zaretskii @ 2005-04-06 17:23 UTC (permalink / raw)
  Cc: emacs-devel

> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Wed, 06 Apr 2005 01:17:11 -0700
> 
> This comment in tty-colors.el:tty-color-standard-values 
> 
>          ;; Translate the string "#XXYYZZ" into a list
>          ;; of numbers (XX YY ZZ).  If the primary colors
>          ;; are specified with less than 4 hex digits,
>          ;; the used digits represent the most significant
>          ;; bits of the value (e.g. #XYZ = #X000Y000Z000).
> 
> does not seem to match the way the `color-name-rgb-alist' seem to have
> been created from the values in rgb.txt. 
> A random example:
> >From color-name-rgb-alist:
>     ("lavenderblush"    65535   61680   62965)
>                         ^^^^    ^^^^    ^^^^
>                         0xffff  0xf0f0  0xf5f5      
> 
> >From rgb.txt: lavender blush     255   240   245
>                                  0xff  0xf0  0xf5
> So the 8 to 16 bit conversion seems use the same byte value for both
> the high and low byte value. 

The comment you cited reflects what I found in the X documentation.
Here, for example, is an excerpt from the X(7) man page on a Debian
GNU/Linux box (fencepost.gnu.org):

       For backward compatibility, an older syntax for RGB Device
       is  supported,  but  its  continued use is not encouraged.
       The syntax is an initial sharp sign character followed  by
       a numeric specification, in one of the following formats:

           #RGB                      (4 bits each)
           #RRGGBB                   (8 bits each)
           #RRRGGGBBB                (12 bits each)
           #RRRRGGGGBBBB             (16 bits each)

       The R, G, and B represent single hexadecimal digits.  When
       fewer than 16 bits each are specified, they represent  the
       most-significant bits of the value (unlike the "rgb:" syn-
       tax, in which values are scaled).  For  example,  #3a7  is
       the same as #3000a0007000.

So I think the code in tty-colors.el is correct in this matter.  It
is, however, possible that the RGB values in color-name-rgb-alist were
incorrectly scaled from 8-bit variants, and need to be amended.

> With this fixes the gray colors are mapped linearly, and so are the
> red1, blue1 and green1 colors (I checked the pixels in a screenshot).

Does ``this fix'' above refer to the changes in xterm.el alone, or to
the change in tty-colors.el as well?  I think we should make the
changes in xterm.el, but not in tty-colors.el.

> Some standard face definitions use colors like "red" or "blue". They 
> should be changed "red1" (or "blue1")

Yes, I agree.  Can you post a patch to do that?

> Thanks!

And thank _you_ for working on this.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-06 17:23 ` Eli Zaretskii
@ 2005-04-06 17:36   ` David Kastrup
  2005-04-06 17:46     ` Eli Zaretskii
                       ` (2 more replies)
  2005-04-06 17:52   ` Dan Nicolaescu
       [not found]   ` <200504062134.j36LY8AH022227@scanner2.ics.uci.edu>
  2 siblings, 3 replies; 22+ messages in thread
From: David Kastrup @ 2005-04-06 17:36 UTC (permalink / raw)
  Cc: Dan Nicolaescu, emacs-devel

"Eli Zaretskii" <eliz@gnu.org> writes:

>> From: Dan Nicolaescu <dann@ics.uci.edu>
>> Date: Wed, 06 Apr 2005 01:17:11 -0700
>> 
>> This comment in tty-colors.el:tty-color-standard-values 
>> 
>>          ;; Translate the string "#XXYYZZ" into a list
>>          ;; of numbers (XX YY ZZ).  If the primary colors
>>          ;; are specified with less than 4 hex digits,
>>          ;; the used digits represent the most significant
>>          ;; bits of the value (e.g. #XYZ = #X000Y000Z000).
>> 
>> does not seem to match the way the `color-name-rgb-alist' seem to have
>> been created from the values in rgb.txt. 
>> A random example:
>> >From color-name-rgb-alist:
>>     ("lavenderblush"    65535   61680   62965)
>>                         ^^^^    ^^^^    ^^^^
>>                         0xffff  0xf0f0  0xf5f5      
>> 
>> >From rgb.txt: lavender blush     255   240   245
>>                                  0xff  0xf0  0xf5
>> So the 8 to 16 bit conversion seems use the same byte value for both
>> the high and low byte value. 
>
> The comment you cited reflects what I found in the X documentation.
> Here, for example, is an excerpt from the X(7) man page on a Debian
> GNU/Linux box (fencepost.gnu.org):
>
>        For backward compatibility, an older syntax for RGB Device
>        is  supported,  but  its  continued use is not encouraged.
>        The syntax is an initial sharp sign character followed  by
>        a numeric specification, in one of the following formats:
>
>            #RGB                      (4 bits each)
>            #RRGGBB                   (8 bits each)
>            #RRRGGGBBB                (12 bits each)
>            #RRRRGGGGBBBB             (16 bits each)
>
>        The R, G, and B represent single hexadecimal digits.  When
>        fewer than 16 bits each are specified, they represent  the
>        most-significant bits of the value (unlike the "rgb:" syn-
>        tax, in which values are scaled).  For  example,  #3a7  is
>        the same as #3000a0007000.
>
> So I think the code in tty-colors.el is correct in this matter.  It
> is, however, possible that the RGB values in color-name-rgb-alist were
> incorrectly scaled from 8-bit variants, and need to be amended.

Actually, it does not make sense to scale in that way.  #3a7 really
should be the same as #3333aaaa7777, so that #fff is the same as
#ffffffffffff, pure white.

Somebody should tell the X people to do that.  I just have no idea who
to tell, and it would appear that there is a bit of previous art that
might rely on the current behavior...

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-06 17:36   ` David Kastrup
@ 2005-04-06 17:46     ` Eli Zaretskii
  2005-04-06 18:03       ` David Kastrup
  2005-04-06 18:26     ` Dan Nicolaescu
  2005-04-07 20:43     ` James Cloos
  2 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2005-04-06 17:46 UTC (permalink / raw)
  Cc: dann, emacs-devel

> Cc: Dan Nicolaescu <dann@ics.uci.edu>,  emacs-devel@gnu.org
> From: David Kastrup <dak@gnu.org>
> Date: Wed, 06 Apr 2005 19:36:27 +0200
> 
> >        The R, G, and B represent single hexadecimal digits.  When
> >        fewer than 16 bits each are specified, they represent  the
> >        most-significant bits of the value (unlike the "rgb:" syn-
> >        tax, in which values are scaled).  For  example,  #3a7  is
> >        the same as #3000a0007000.
> >
> > So I think the code in tty-colors.el is correct in this matter.  It
> > is, however, possible that the RGB values in color-name-rgb-alist were
> > incorrectly scaled from 8-bit variants, and need to be amended.
> 
> Actually, it does not make sense to scale in that way.  #3a7 really
> should be the same as #3333aaaa7777, so that #fff is the same as
> #ffffffffffff, pure white.

That could be so, but:

 (1) The #RRGGBB syntax being a legacy thingy, I don't believe anyone
     will want to change it; and

 (2) As long as X does it this way, so must we, because when Emacs
     runs on X, the #RRGGBB spec is parsed by the X server, not by
     Emacs (Emacs just hands the spec to X).  If tty-colors.el doesn't
     do _exactly_ the same, a color specified by the same #RRGGBB will
     look differently in an xterm and on X.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-06 17:23 ` Eli Zaretskii
  2005-04-06 17:36   ` David Kastrup
@ 2005-04-06 17:52   ` Dan Nicolaescu
       [not found]     ` <01c53aea$Blat.v2.4$16ee4740@zahav.net.il>
       [not found]   ` <200504062134.j36LY8AH022227@scanner2.ics.uci.edu>
  2 siblings, 1 reply; 22+ messages in thread
From: Dan Nicolaescu @ 2005-04-06 17:52 UTC (permalink / raw)
  Cc: emacs-devel

"Eli Zaretskii" <eliz@gnu.org> writes:

  > > From: Dan Nicolaescu <dann@ics.uci.edu>
  > > Date: Wed, 06 Apr 2005 01:17:11 -0700
  > > 
[snip]
  > So I think the code in tty-colors.el is correct in this matter.  It
  > is, however, possible that the RGB values in color-name-rgb-alist were
  > incorrectly scaled from 8-bit variants, and need to be amended.

Agreed. The problem seems to be that tty-colors.el and color-name-rgb-alist
don't use the same of scaling. 
Do you want me to do check if rescaling the values in
color-name-rgb-alist gives good results?

  > 
  > > With this fixes the gray colors are mapped linearly, and so are the
  > > red1, blue1 and green1 colors (I checked the pixels in a screenshot).
  > 
  > Does ``this fix'' above refer to the changes in xterm.el alone, or to
  > the change in tty-colors.el as well?  I think we should make the
  > changes in xterm.el, but not in tty-colors.el.

By "fixes" I meant all the patches that I posted together, I did not
test them separately. (anyway the tty-colors.el patch should have zero
influence on what I saw because AFAICT that code path is only used
when creating a color from  #RGB, xterm-register-default-colors does
its own scaling).
If you don't want the tty-colors.el changes, then ene of the changes
in xterm.el, the one to xterm-rgb-convert-to-16bit is not good, it
should be 

        (lsh prim 8)
instead of:
  (logior prim (lsh prim 8))

The patch to xterm-standard-colors is obviously correct, so I could
check that in right now if you want. 

  > > Some standard face definitions use colors like "red" or "blue". They 
  > > should be changed "red1" (or "blue1")
  > 
  > Yes, I agree.  Can you post a patch to do that?

Will do. 

  > And thank _you_ for working on this.

Well that you too, our private mail discussion put me on the right
track to find out what the problem was. 

      --dan

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-06 17:46     ` Eli Zaretskii
@ 2005-04-06 18:03       ` David Kastrup
  0 siblings, 0 replies; 22+ messages in thread
From: David Kastrup @ 2005-04-06 18:03 UTC (permalink / raw)


"Eli Zaretskii" <eliz@gnu.org> writes:

>> From: David Kastrup <dak@gnu.org>

>> Actually, it does not make sense to scale in that way.  #3a7 really
>> should be the same as #3333aaaa7777, so that #fff is the same as
>> #ffffffffffff, pure white.
>
> That could be so, but:
>
>  (1) The #RRGGBB syntax being a legacy thingy, I don't believe anyone
>      will want to change it;

I'll grant that it is highly probably that this rather obvious
amendment has been previously proposed.  Maybe one would need an
alternative syntax like %RRGGBB that would then be expanded in the
more natural way of repetition instead of null-padding.  Who would one
have to approach for that, anyway?  The Open Group?

>  and
>
>  (2) As long as X does it this way, so must we,

Surely.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-06 17:36   ` David Kastrup
  2005-04-06 17:46     ` Eli Zaretskii
@ 2005-04-06 18:26     ` Dan Nicolaescu
  2005-04-07 20:43     ` James Cloos
  2 siblings, 0 replies; 22+ messages in thread
From: Dan Nicolaescu @ 2005-04-06 18:26 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

David Kastrup <dak@gnu.org> writes:

  > "Eli Zaretskii" <eliz@gnu.org> writes:
  > 
  > >> From: Dan Nicolaescu <dann@ics.uci.edu>
  > >> Date: Wed, 06 Apr 2005 01:17:11 -0700
  > >> 
  > >> This comment in tty-colors.el:tty-color-standard-values 
  > >> 
  > >>          ;; Translate the string "#XXYYZZ" into a list
  > >>          ;; of numbers (XX YY ZZ).  If the primary colors
  > >>          ;; are specified with less than 4 hex digits,
  > >>          ;; the used digits represent the most significant
  > >>          ;; bits of the value (e.g. #XYZ = #X000Y000Z000).
  > >> 
  > >> does not seem to match the way the `color-name-rgb-alist' seem to have
  > >> been created from the values in rgb.txt. 
  > >> A random example:
  > >> >From color-name-rgb-alist:
  > >>     ("lavenderblush"    65535   61680   62965)
  > >>                         ^^^^    ^^^^    ^^^^
  > >>                         0xffff  0xf0f0  0xf5f5      
  > >> 
  > >> >From rgb.txt: lavender blush     255   240   245
  > >>                                  0xff  0xf0  0xf5
  > >> So the 8 to 16 bit conversion seems use the same byte value for both
  > >> the high and low byte value. 
  > >
  > > The comment you cited reflects what I found in the X documentation.
  > > Here, for example, is an excerpt from the X(7) man page on a Debian
  > > GNU/Linux box (fencepost.gnu.org):
  > >
  > >        For backward compatibility, an older syntax for RGB Device
  > >        is  supported,  but  its  continued use is not encouraged.
  > >        The syntax is an initial sharp sign character followed  by
  > >        a numeric specification, in one of the following formats:
  > >
  > >            #RGB                      (4 bits each)
  > >            #RRGGBB                   (8 bits each)
  > >            #RRRGGGBBB                (12 bits each)
  > >            #RRRRGGGGBBBB             (16 bits each)
  > >
  > >        The R, G, and B represent single hexadecimal digits.  When
  > >        fewer than 16 bits each are specified, they represent  the
  > >        most-significant bits of the value (unlike the "rgb:" syn-
  > >        tax, in which values are scaled).  For  example,  #3a7  is
  > >        the same as #3000a0007000.
  > >
  > > So I think the code in tty-colors.el is correct in this matter.  It
  > > is, however, possible that the RGB values in color-name-rgb-alist were
  > > incorrectly scaled from 8-bit variants, and need to be amended.
  > 
  > Actually, it does not make sense to scale in that way.  #3a7 really
  > should be the same as #3333aaaa7777, so that #fff is the same as
  > #ffffffffffff, pure white.

Hmmm, looking just a few lines above the lines Eli cited from the X
manual you can find this:

       The eight primary colors can be represented as:

           black                rgb:0/0/0
           red                  rgb:ffff/0/0
           green                rgb:0/ffff/0
           blue                 rgb:0/0/ffff
           yellow               rgb:ffff/ffff/0
           magenta              rgb:ffff/0/ffff
           cyan                 rgb:0/ffff/ffff
           white                rgb:ffff/ffff/ffff

So does this mean that 0xff is gets a special treatment when scaling? 
Or it means that the #3000a0007000 example is incorrect? 
Does anybody know? 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
       [not found]     ` <01c53aea$Blat.v2.4$16ee4740@zahav.net.il>
@ 2005-04-06 23:50       ` Dan Nicolaescu
  2005-04-07  0:22         ` David Kastrup
  2005-04-07  3:55         ` Eli Zaretskii
  0 siblings, 2 replies; 22+ messages in thread
From: Dan Nicolaescu @ 2005-04-06 23:50 UTC (permalink / raw)
  Cc: emacs-devel

"Eli Zaretskii" <eliz@gnu.org> writes:

  > > Cc: emacs-devel@gnu.org
  > > From: Dan Nicolaescu <dann@ics.uci.edu>
  > > Date: Wed, 06 Apr 2005 10:52:26 -0700
  > > 
  > > Agreed. The problem seems to be that tty-colors.el and color-name-rgb-alist
  > > don't use the same of scaling. 
  > > Do you want me to do check if rescaling the values in
  > > color-name-rgb-alist gives good results?
  > 
  > Yes, please.

I checked and I could not see any difference in behavior compared to the
approach in my first patch.

Is this OK? 

Index: lisp/term/xterm.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/xterm.el,v
retrieving revision 1.11
diff -c -3 -p -r1.11 xterm.el
*** lisp/term/xterm.el	6 Apr 2005 21:38:34 -0000	1.11
--- lisp/term/xterm.el	6 Apr 2005 23:35:51 -0000
***************
*** 123,129 ****
  
  (defun xterm-rgb-convert-to-16bit (prim)
    "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
!   (min 65535 (round (* (/ prim 255.0) 65535.0))))
  
  (defun xterm-register-default-colors ()
    "Register the default set of colors for xterm or compatible emulator.
--- 123,129 ----
  
  (defun xterm-rgb-convert-to-16bit (prim)
    "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
!   (lsh prim 8))
  
  (defun xterm-register-default-colors ()
    "Register the default set of colors for xterm or compatible emulator.
*************** versions of xterm."
*** 160,168 ****
  	    (tty-color-define (format "color-%d" (- 256 ncolors))
  			      (- 256 ncolors)
  			      (mapcar 'xterm-rgb-convert-to-16bit
! 				      (list (round (* r 42.5))
! 					    (round (* g 42.5))
! 					    (round (* b 42.5)))))
  	    (setq b (1+ b))
  	    (if (> b 5)
  		(setq g (1+ g)
--- 160,169 ----
  	    (tty-color-define (format "color-%d" (- 256 ncolors))
  			      (- 256 ncolors)
  			      (mapcar 'xterm-rgb-convert-to-16bit
! 				      (list (if (zerop r) 0 (+ (* r 40) 55))
! 					    (if (zerop g) 0 (+ (* g 40) 55))
! 					    (if (zerop b) 0 (+ (* b 40) 55)))))
! 
  	    (setq b (1+ b))
  	    (if (> b 5)
  		(setq g (1+ g)
Index: lisp/term/tty-colors.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/tty-colors.el,v
retrieving revision 1.14
diff -c -3 -p -r1.14 tty-colors.el
*** lisp/term/tty-colors.el	24 Jul 2004 21:56:26 -0000	1.14
--- lisp/term/tty-colors.el	6 Apr 2005 23:35:51 -0000
***************
*** 86,748 ****
  ;; of each value are actually identical).
  ;;
  (defvar color-name-rgb-alist
!   '(("snow"		65535 64250 64250)
!     ("ghostwhite"	63736 63736 65535)
!     ("whitesmoke"	62965 62965 62965)
!     ("gainsboro"	56540 56540 56540)
!     ("floralwhite"	65535 64250 61680)
!     ("oldlace"		65021 62965 59110)
!     ("linen"		64250 61680 59110)
!     ("antiquewhite"	64250 60395 55255)
!     ("papayawhip"	65535 61423 54741)
!     ("blanchedalmond"	65535 60395 52685)
!     ("bisque"		65535 58596 50372)
!     ("peachpuff"	65535 56026 47545)
!     ("navajowhite"	65535 57054 44461)
!     ("moccasin"		65535 58596 46517)
!     ("cornsilk"		65535 63736 56540)
!     ("ivory"		65535 65535 61680)
!     ("lemonchiffon"	65535 64250 52685)
!     ("seashell"		65535 62965 61166)
!     ("honeydew"		61680 65535 61680)
!     ("mintcream"	62965 65535 64250)
!     ("azure"		61680 65535 65535)
!     ("aliceblue"	61680 63736 65535)
!     ("lavender"		59110 59110 64250)
!     ("lavenderblush"	65535 61680 62965)
!     ("mistyrose"	65535 58596 57825)
!     ("white"		65535 65535 65535)
!     ("black"		    0     0     0)
!     ("darkslategray"	12079 20303 20303)
!     ("darkslategrey"	12079 20303 20303)
!     ("dimgray"		26985 26985 26985)
!     ("dimgrey"		26985 26985 26985)
!     ("slategray"	28784 32896 37008)
!     ("slategrey"	28784 32896 37008)
!     ("lightslategray"	30583 34952 39321)
!     ("lightslategrey"	30583 34952 39321)
!     ("gray"		48830 48830 48830)
!     ("grey"		48830 48830 48830)
!     ("lightgrey"	54227 54227 54227)
!     ("lightgray"	54227 54227 54227)
!     ("midnightblue"	 6425  6425 28784)
!     ("navy"		    0     0 32896)
!     ("navyblue"		    0     0 32896)
!     ("cornflowerblue"	25700 38293 60909)
!     ("darkslateblue"	18504 15677 35723)
!     ("slateblue"	27242 23130 52685)
!     ("mediumslateblue"	31611 26728 61166)
!     ("lightslateblue"	33924 28784 65535)
!     ("mediumblue"	    0     0 52685)
!     ("royalblue"	16705 26985 57825)
!     ("blue"		    0     0 65535)
!     ("dodgerblue"	 7710 37008 65535)
!     ("deepskyblue"	    0 49087 65535)
!     ("skyblue"		34695 52942 60395)
!     ("lightskyblue"	34695 52942 64250)
!     ("steelblue"	17990 33410 46260)
!     ("lightsteelblue"	45232 50372 57054)
!     ("lightblue"	44461 55512 59110)
!     ("powderblue"	45232 57568 59110)
!     ("paleturquoise"	44975 61166 61166)
!     ("darkturquoise"	    0 52942 53713)
!     ("mediumturquoise"	18504 53713 52428)
!     ("turquoise"	16448 57568 53456)
!     ("cyan"		    0 65535 65535)
!     ("lightcyan"	57568 65535 65535)
!     ("cadetblue"	24415 40606 41120)
!     ("mediumaquamarine"	26214 52685 43690)
!     ("aquamarine"	32639 65535 54484)
!     ("darkgreen"	    0 25700     0)
!     ("darkolivegreen"	21845 27499 12079)
!     ("darkseagreen"	36751 48316 36751)
!     ("seagreen"		11822 35723 22359)
!     ("mediumseagreen"	15420 46003 29041)
!     ("lightseagreen"	 8224 45746 43690)
!     ("palegreen"	39064 64507 39064)
!     ("springgreen"	    0 65535 32639)
!     ("lawngreen"	31868 64764     0)
!     ("green"		    0 65535     0)
!     ("chartreuse"	32639 65535     0)
!     ("mediumspringgreen"    0 64250 39578)
!     ("greenyellow"	44461 65535 12079)
!     ("limegreen"	12850 52685 12850)
!     ("yellowgreen"	39578 52685 12850)
!     ("forestgreen"	 8738 35723  8738)
!     ("olivedrab"	27499 36494  8995)
!     ("darkkhaki"	48573 47031 27499)
!     ("khaki"		61680 59110 35980)
!     ("palegoldenrod"	61166 59624 43690)
!     ("lightgoldenrodyellow" 64250 64250 53970)
!     ("lightyellow"	65535 65535 57568)
!     ("yellow"		65535 65535     0)
!     ("gold"		65535 55255     0)
!     ("lightgoldenrod"	61166 56797 33410)
!     ("goldenrod"	56026 42405  8224)
!     ("darkgoldenrod"	47288 34438  2827)
!     ("rosybrown"	48316 36751 36751)
!     ("indianred"	52685 23644 23644)
!     ("saddlebrown"	35723 17733  4883)
!     ("sienna"		41120 21074 11565)
!     ("peru"		52685 34181 16191)
!     ("burlywood"	57054 47288 34695)
!     ("beige"		62965 62965 56540)
!     ("wheat"		62965 57054 46003)
!     ("sandybrown"	62708 42148 24672)
!     ("tan"		53970 46260 35980)
!     ("chocolate"	53970 26985  7710)
!     ("firebrick"	45746  8738  8738)
!     ("brown"		42405 10794 10794)
!     ("darksalmon"	59881 38550 31354)
!     ("salmon"		64250 32896 29298)
!     ("lightsalmon"	65535 41120 31354)
!     ("orange"		65535 42405     0)
!     ("darkorange"	65535 35980     0)
!     ("coral"		65535 32639 20560)
!     ("lightcoral"	61680 32896 32896)
!     ("tomato"		65535 25443 18247)
!     ("orangered"	65535 17733     0)
!     ("red"		65535     0     0)
!     ("hotpink"		65535 26985 46260)
!     ("deeppink"		65535  5140 37779)
!     ("pink"		65535 49344 52171)
!     ("lightpink"	65535 46774 49601)
!     ("palevioletred"	56283 28784 37779)
!     ("maroon"		45232 12336 24672)
!     ("mediumvioletred"	51143  5397 34181)
!     ("violetred"	53456  8224 37008)
!     ("magenta"		65535     0 65535)
!     ("violet"		61166 33410 61166)
!     ("plum"		56797 41120 56797)
!     ("orchid"		56026 28784 54998)
!     ("mediumorchid"	47802 21845 54227)
!     ("darkorchid"	39321 12850 52428)
!     ("darkviolet"	38036     0 54227)
!     ("blueviolet"	35466 11051 58082)
!     ("purple"		41120  8224 61680)
!     ("mediumpurple"	37779 28784 56283)
!     ("thistle"		55512 49087 55512)
!     ("snow1"		65535 64250 64250)
!     ("snow2"		61166 59881 59881)
!     ("snow3"		52685 51657 51657)
!     ("snow4"		35723 35209 35209)
!     ("seashell1"	65535 62965 61166)
!     ("seashell2"	61166 58853 57054)
!     ("seashell3"	52685 50629 49087)
!     ("seashell4"	35723 34438 33410)
!     ("antiquewhite1"	65535 61423 56283)
!     ("antiquewhite2"	61166 57311 52428)
!     ("antiquewhite3"	52685 49344 45232)
!     ("antiquewhite4"	35723 33667 30840)
!     ("bisque1"		65535 58596 50372)
!     ("bisque2"		61166 54741 47031)
!     ("bisque3"		52685 47031 40606)
!     ("bisque4"		35723 32125 27499)
!     ("peachpuff1"	65535 56026 47545)
!     ("peachpuff2"	61166 52171 44461)
!     ("peachpuff3"	52685 44975 38293)
!     ("peachpuff4"	35723 30583 25957)
!     ("navajowhite1"	65535 57054 44461)
!     ("navajowhite2"	61166 53199 41377)
!     ("navajowhite3"	52685 46003 35723)
!     ("navajowhite4"	35723 31097 24158)
!     ("lemonchiffon1"	65535 64250 52685)
!     ("lemonchiffon2"	61166 59881 49087)
!     ("lemonchiffon3"	52685 51657 42405)
!     ("lemonchiffon4"	35723 35209 28784)
!     ("cornsilk1"	65535 63736 56540)
!     ("cornsilk2"	61166 59624 52685)
!     ("cornsilk3"	52685 51400 45489)
!     ("cornsilk4"	35723 34952 30840)
!     ("ivory1"		65535 65535 61680)
!     ("ivory2"		61166 61166 57568)
!     ("ivory3"		52685 52685 49601)
!     ("ivory4"		35723 35723 33667)
!     ("honeydew1"	61680 65535 61680)
!     ("honeydew2"	57568 61166 57568)
!     ("honeydew3"	49601 52685 49601)
!     ("honeydew4"	33667 35723 33667)
!     ("lavenderblush1"	65535 61680 62965)
!     ("lavenderblush2"	61166 57568 58853)
!     ("lavenderblush3"	52685 49601 50629)
!     ("lavenderblush4"	35723 33667 34438)
!     ("mistyrose1"	65535 58596 57825)
!     ("mistyrose2"	61166 54741 53970)
!     ("mistyrose3"	52685 47031 46517)
!     ("mistyrose4"	35723 32125 31611)
!     ("azure1"		61680 65535 65535)
!     ("azure2"		57568 61166 61166)
!     ("azure3"		49601 52685 52685)
!     ("azure4"		33667 35723 35723)
!     ("slateblue1"	33667 28527 65535)
!     ("slateblue2"	31354 26471 61166)
!     ("slateblue3"	26985 22873 52685)
!     ("slateblue4"	18247 15420 35723)
!     ("royalblue1"	18504 30326 65535)
!     ("royalblue2"	17219 28270 61166)
!     ("royalblue3"	14906 24415 52685)
!     ("royalblue4"	10023 16448 35723)
!     ("blue1"		    0     0 65535)
!     ("blue2"		    0     0 61166)
!     ("blue3"		    0     0 52685)
!     ("blue4"		    0     0 35723)
!     ("dodgerblue1"	 7710 37008 65535)
!     ("dodgerblue2"	 7196 34438 61166)
!     ("dodgerblue3"	 6168 29812 52685)
!     ("dodgerblue4"	 4112 20046 35723)
!     ("steelblue1"	25443 47288 65535)
!     ("steelblue2"	23644 44204 61166)
!     ("steelblue3"	20303 38036 52685)
!     ("steelblue4"	13878 25700 35723)
!     ("deepskyblue1"	    0 49087 65535)
!     ("deepskyblue2"	    0 45746 61166)
!     ("deepskyblue3"	    0 39578 52685)
!     ("deepskyblue4"	    0 26728 35723)
!     ("skyblue1"		34695 52942 65535)
!     ("skyblue2"		32382 49344 61166)
!     ("skyblue3"		27756 42662 52685)
!     ("skyblue4"		19018 28784 35723)
!     ("lightskyblue1"	45232 58082 65535)
!     ("lightskyblue2"	42148 54227 61166)
!     ("lightskyblue3"	36237 46774 52685)
!     ("lightskyblue4"	24672 31611 35723)
!     ("slategray1"	50886 58082 65535)
!     ("slategray2"	47545 54227 61166)
!     ("slategray3"	40863 46774 52685)
!     ("slategray4"	27756 31611 35723)
!     ("lightsteelblue1"	51914 57825 65535)
!     ("lightsteelblue2"	48316 53970 61166)
!     ("lightsteelblue3"	41634 46517 52685)
!     ("lightsteelblue4"	28270 31611 35723)
!     ("lightblue1"	49087 61423 65535)
!     ("lightblue2"	45746 57311 61166)
!     ("lightblue3"	39578 49344 52685)
!     ("lightblue4"	26728 33667 35723)
!     ("lightcyan1"	57568 65535 65535)
!     ("lightcyan2"	53713 61166 61166)
!     ("lightcyan3"	46260 52685 52685)
!     ("lightcyan4"	31354 35723 35723)
!     ("paleturquoise1"	48059 65535 65535)
!     ("paleturquoise2"	44718 61166 61166)
!     ("paleturquoise3"	38550 52685 52685)
!     ("paleturquoise4"	26214 35723 35723)
!     ("cadetblue1"	39064 62965 65535)
!     ("cadetblue2"	36494 58853 61166)
!     ("cadetblue3"	31354 50629 52685)
!     ("cadetblue4"	21331 34438 35723)
!     ("turquoise1"	    0 62965 65535)
!     ("turquoise2"	    0 58853 61166)
!     ("turquoise3"	    0 50629 52685)
!     ("turquoise4"	    0 34438 35723)
!     ("cyan1"		    0 65535 65535)
!     ("cyan2"		    0 61166 61166)
!     ("cyan3"		    0 52685 52685)
!     ("cyan4"		    0 35723 35723)
!     ("darkslategray1"	38807 65535 65535)
!     ("darkslategray2"	36237 61166 61166)
!     ("darkslategray3"	31097 52685 52685)
!     ("darkslategray4"	21074 35723 35723)
!     ("aquamarine1"	32639 65535 54484)
!     ("aquamarine2"	30326 61166 50886)
!     ("aquamarine3"	26214 52685 43690)
!     ("aquamarine4"	17733 35723 29812)
!     ("darkseagreen1"	49601 65535 49601)
!     ("darkseagreen2"	46260 61166 46260)
!     ("darkseagreen3"	39835 52685 39835)
!     ("darkseagreen4"	26985 35723 26985)
!     ("seagreen1"	21588 65535 40863)
!     ("seagreen2"	20046 61166 38036)
!     ("seagreen3"	17219 52685 32896)
!     ("seagreen4"	11822 35723 22359)
!     ("palegreen1"	39578 65535 39578)
!     ("palegreen2"	37008 61166 37008)
!     ("palegreen3"	31868 52685 31868)
!     ("palegreen4"	21588 35723 21588)
!     ("springgreen1"	    0 65535 32639)
!     ("springgreen2"	    0 61166 30326)
!     ("springgreen3"	    0 52685 26214)
!     ("springgreen4"	    0 35723 17733)
!     ("green1"		    0 65535     0)
!     ("green2"		    0 61166     0)
!     ("green3"		    0 52685     0)
!     ("green4"		    0 35723     0)
!     ("chartreuse1"	32639 65535     0)
!     ("chartreuse2"	30326 61166     0)
!     ("chartreuse3"	26214 52685     0)
!     ("chartreuse4"	17733 35723     0)
!     ("olivedrab1"	49344 65535 15934)
!     ("olivedrab2"	46003 61166 14906)
!     ("olivedrab3"	39578 52685 12850)
!     ("olivedrab4"	26985 35723  8738)
!     ("darkolivegreen1"	51914 65535 28784)
!     ("darkolivegreen2"	48316 61166 26728)
!     ("darkolivegreen3"	41634 52685 23130)
!     ("darkolivegreen4"	28270 35723 15677)
!     ("khaki1"		65535 63222 36751)
!     ("khaki2"		61166 59110 34181)
!     ("khaki3"		52685 50886 29555)
!     ("khaki4"		35723 34438 20046)
!     ("lightgoldenrod1"	65535 60652 35723)
!     ("lightgoldenrod2"	61166 56540 33410)
!     ("lightgoldenrod3"	52685 48830 28784)
!     ("lightgoldenrod4"	35723 33153 19532)
!     ("lightyellow1"	65535 65535 57568)
!     ("lightyellow2"	61166 61166 53713)
!     ("lightyellow3"	52685 52685 46260)
!     ("lightyellow4"	35723 35723 31354)
!     ("yellow1"		65535 65535     0)
!     ("yellow2"		61166 61166     0)
!     ("yellow3"		52685 52685     0)
!     ("yellow4"		35723 35723     0)
!     ("gold1"		65535 55255     0)
!     ("gold2"		61166 51657     0)
!     ("gold3"		52685 44461     0)
!     ("gold4"		35723 30069     0)
!     ("goldenrod1"	65535 49601  9509)
!     ("goldenrod2"	61166 46260  8738)
!     ("goldenrod3"	52685 39835  7453)
!     ("goldenrod4"	35723 26985  5140)
!     ("darkgoldenrod1"	65535 47545  3855)
!     ("darkgoldenrod2"	61166 44461  3598)
!     ("darkgoldenrod3"	52685 38293  3084)
!     ("darkgoldenrod4"	35723 25957  2056)
!     ("rosybrown1"	65535 49601 49601)
!     ("rosybrown2"	61166 46260 46260)
!     ("rosybrown3"	52685 39835 39835)
!     ("rosybrown4"	35723 26985 26985)
!     ("indianred1"	65535 27242 27242)
!     ("indianred2"	61166 25443 25443)
!     ("indianred3"	52685 21845 21845)
!     ("indianred4"	35723 14906 14906)
!     ("sienna1"		65535 33410 18247)
!     ("sienna2"		61166 31097 16962)
!     ("sienna3"		52685 26728 14649)
!     ("sienna4"		35723 18247  9766)
!     ("burlywood1"	65535 54227 39835)
!     ("burlywood2"	61166 50629 37265)
!     ("burlywood3"	52685 43690 32125)
!     ("burlywood4"	35723 29555 21845)
!     ("wheat1"		65535 59367 47802)
!     ("wheat2"		61166 55512 44718)
!     ("wheat3"		52685 47802 38550)
!     ("wheat4"		35723 32382 26214)
!     ("tan1"		65535 42405 20303)
!     ("tan2"		61166 39578 18761)
!     ("tan3"		52685 34181 16191)
!     ("tan4"		35723 23130 11051)
!     ("chocolate1"	65535 32639  9252)
!     ("chocolate2"	61166 30326  8481)
!     ("chocolate3"	52685 26214  7453)
!     ("chocolate4"	35723 17733  4883)
!     ("firebrick1"	65535 12336 12336)
!     ("firebrick2"	61166 11308 11308)
!     ("firebrick3"	52685  9766  9766)
!     ("firebrick4"	35723  6682  6682)
!     ("brown1"		65535 16448 16448)
!     ("brown2"		61166 15163 15163)
!     ("brown3"		52685 13107 13107)
!     ("brown4"		35723  8995  8995)
!     ("salmon1"		65535 35980 26985)
!     ("salmon2"		61166 33410 25186)
!     ("salmon3"		52685 28784 21588)
!     ("salmon4"		35723 19532 14649)
!     ("lightsalmon1"	65535 41120 31354)
!     ("lightsalmon2"	61166 38293 29298)
!     ("lightsalmon3"	52685 33153 25186)
!     ("lightsalmon4"	35723 22359 16962)
!     ("orange1"		65535 42405     0)
!     ("orange2"		61166 39578     0)
!     ("orange3"		52685 34181     0)
!     ("orange4"		35723 23130     0)
!     ("darkorange1"	65535 32639     0)
!     ("darkorange2"	61166 30326     0)
!     ("darkorange3"	52685 26214     0)
!     ("darkorange4"	35723 17733     0)
!     ("coral1"		65535 29298 22102)
!     ("coral2"		61166 27242 20560)
!     ("coral3"		52685 23387 17733)
!     ("coral4"		35723 15934 12079)
!     ("tomato1"		65535 25443 18247)
!     ("tomato2"		61166 23644 16962)
!     ("tomato3"		52685 20303 14649)
!     ("tomato4"		35723 13878  9766)
!     ("orangered1"	65535 17733     0)
!     ("orangered2"	61166 16448     0)
!     ("orangered3"	52685 14135     0)
!     ("orangered4"	35723  9509     0)
!     ("red1"		65535     0     0)
!     ("red2"		61166     0     0)
!     ("red3"		52685     0     0)
!     ("red4"		35723     0     0)
!     ("deeppink1"	65535  5140 37779)
!     ("deeppink2"	61166  4626 35209)
!     ("deeppink3"	52685  4112 30326)
!     ("deeppink4"	35723  2570 20560)
!     ("hotpink1"		65535 28270 46260)
!     ("hotpink2"		61166 27242 42919)
!     ("hotpink3"		52685 24672 37008)
!     ("hotpink4"		35723 14906 25186)
!     ("pink1"		65535 46517 50629)
!     ("pink2"		61166 43433 47288)
!     ("pink3"		52685 37265 40606)
!     ("pink4"		35723 25443 27756)
!     ("lightpink1"	65535 44718 47545)
!     ("lightpink2"	61166 41634 44461)
!     ("lightpink3"	52685 35980 38293)
!     ("lightpink4"	35723 24415 25957)
!     ("palevioletred1"	65535 33410 43947)
!     ("palevioletred2"	61166 31097 40863)
!     ("palevioletred3"	52685 26728 35209)
!     ("palevioletred4"	35723 18247 23901)
!     ("maroon1"		65535 13364 46003)
!     ("maroon2"		61166 12336 42919)
!     ("maroon3"		52685 10537 37008)
!     ("maroon4"		35723  7196 25186)
!     ("violetred1"	65535 15934 38550)
!     ("violetred2"	61166 14906 35980)
!     ("violetred3"	52685 12850 30840)
!     ("violetred4"	35723  8738 21074)
!     ("magenta1"		65535     0 65535)
!     ("magenta2"		61166     0 61166)
!     ("magenta3"		52685     0 52685)
!     ("magenta4"		35723     0 35723)
!     ("orchid1"		65535 33667 64250)
!     ("orchid2"		61166 31354 59881)
!     ("orchid3"		52685 26985 51657)
!     ("orchid4"		35723 18247 35209)
!     ("plum1"		65535 48059 65535)
!     ("plum2"		61166 44718 61166)
!     ("plum3"		52685 38550 52685)
!     ("plum4"		35723 26214 35723)
!     ("mediumorchid1"	57568 26214 65535)
!     ("mediumorchid2"	53713 24415 61166)
!     ("mediumorchid3"	46260 21074 52685)
!     ("mediumorchid4"	31354 14135 35723)
!     ("darkorchid1"	49087 15934 65535)
!     ("darkorchid2"	45746 14906 61166)
!     ("darkorchid3"	39578 12850 52685)
!     ("darkorchid4"	26728  8738 35723)
!     ("purple1"		39835 12336 65535)
!     ("purple2"		37265 11308 61166)
!     ("purple3"		32125  9766 52685)
!     ("purple4"		21845  6682 35723)
!     ("mediumpurple1"	43947 33410 65535)
!     ("mediumpurple2"	40863 31097 61166)
!     ("mediumpurple3"	35209 26728 52685)
!     ("mediumpurple4"	23901 18247 35723)
!     ("thistle1"		65535 57825 65535)
!     ("thistle2"		61166 53970 61166)
!     ("thistle3"		52685 46517 52685)
!     ("thistle4"		35723 31611 35723)
!     ("gray0"		    0     0     0)
!     ("grey0"		    0     0     0)
!     ("gray1"		  771   771   771)
!     ("grey1"		  771   771   771)
!     ("gray2"		 1285  1285  1285)
!     ("grey2"		 1285  1285  1285)
!     ("gray3"		 2056  2056  2056)
!     ("grey3"		 2056  2056  2056)
!     ("gray4"		 2570  2570  2570)
!     ("grey4"		 2570  2570  2570)
!     ("gray5"		 3341  3341  3341)
!     ("grey5"		 3341  3341  3341)
!     ("gray6"		 3855  3855  3855)
!     ("grey6"		 3855  3855  3855)
!     ("gray7"		 4626  4626  4626)
!     ("grey7"		 4626  4626  4626)
!     ("gray8"		 5140  5140  5140)
!     ("grey8"		 5140  5140  5140)
!     ("gray9"		 5911  5911  5911)
!     ("grey9"		 5911  5911  5911)
!     ("gray10"		 6682  6682  6682)
!     ("grey10"		 6682  6682  6682)
!     ("gray11"		 7196  7196  7196)
!     ("grey11"		 7196  7196  7196)
!     ("gray12"		 7967  7967  7967)
!     ("grey12"		 7967  7967  7967)
!     ("gray13"		 8481  8481  8481)
!     ("grey13"		 8481  8481  8481)
!     ("gray14"		 9252  9252  9252)
!     ("grey14"		 9252  9252  9252)
!     ("gray15"		 9766  9766  9766)
!     ("grey15"		 9766  9766  9766)
!     ("gray16"		10537 10537 10537)
!     ("grey16"		10537 10537 10537)
!     ("gray17"		11051 11051 11051)
!     ("grey17"		11051 11051 11051)
!     ("gray18"		11822 11822 11822)
!     ("grey18"		11822 11822 11822)
!     ("gray19"		12336 12336 12336)
!     ("grey19"		12336 12336 12336)
!     ("gray20"		13107 13107 13107)
!     ("grey20"		13107 13107 13107)
!     ("gray21"		13878 13878 13878)
!     ("grey21"		13878 13878 13878)
!     ("gray22"		14392 14392 14392)
!     ("grey22"		14392 14392 14392)
!     ("gray23"		15163 15163 15163)
!     ("grey23"		15163 15163 15163)
!     ("gray24"		15677 15677 15677)
!     ("grey24"		15677 15677 15677)
!     ("gray25"		16448 16448 16448)
!     ("grey25"		16448 16448 16448)
!     ("gray26"		16962 16962 16962)
!     ("grey26"		16962 16962 16962)
!     ("gray27"		17733 17733 17733)
!     ("grey27"		17733 17733 17733)
!     ("gray28"		18247 18247 18247)
!     ("grey28"		18247 18247 18247)
!     ("gray29"		19018 19018 19018)
!     ("grey29"		19018 19018 19018)
!     ("gray30"		19789 19789 19789)
!     ("grey30"		19789 19789 19789)
!     ("gray31"		20303 20303 20303)
!     ("grey31"		20303 20303 20303)
!     ("gray32"		21074 21074 21074)
!     ("grey32"		21074 21074 21074)
!     ("gray33"		21588 21588 21588)
!     ("grey33"		21588 21588 21588)
!     ("gray34"		22359 22359 22359)
!     ("grey34"		22359 22359 22359)
!     ("gray35"		22873 22873 22873)
!     ("grey35"		22873 22873 22873)
!     ("gray36"		23644 23644 23644)
!     ("grey36"		23644 23644 23644)
!     ("gray37"		24158 24158 24158)
!     ("grey37"		24158 24158 24158)
!     ("gray38"		24929 24929 24929)
!     ("grey38"		24929 24929 24929)
!     ("gray39"		25443 25443 25443)
!     ("grey39"		25443 25443 25443)
!     ("gray40"		26214 26214 26214)
!     ("grey40"		26214 26214 26214)
!     ("gray41"		26985 26985 26985)
!     ("grey41"		26985 26985 26985)
!     ("gray42"		27499 27499 27499)
!     ("grey42"		27499 27499 27499)
!     ("gray43"		28270 28270 28270)
!     ("grey43"		28270 28270 28270)
!     ("gray44"		28784 28784 28784)
!     ("grey44"		28784 28784 28784)
!     ("gray45"		29555 29555 29555)
!     ("grey45"		29555 29555 29555)
!     ("gray46"		30069 30069 30069)
!     ("grey46"		30069 30069 30069)
!     ("gray47"		30840 30840 30840)
!     ("grey47"		30840 30840 30840)
!     ("gray48"		31354 31354 31354)
!     ("grey48"		31354 31354 31354)
!     ("gray49"		32125 32125 32125)
!     ("grey49"		32125 32125 32125)
!     ("gray50"		32639 32639 32639)
!     ("grey50"		32639 32639 32639)
!     ("gray51"		33410 33410 33410)
!     ("grey51"		33410 33410 33410)
!     ("gray52"		34181 34181 34181)
!     ("grey52"		34181 34181 34181)
!     ("gray53"		34695 34695 34695)
!     ("grey53"		34695 34695 34695)
!     ("gray54"		35466 35466 35466)
!     ("grey54"		35466 35466 35466)
!     ("gray55"		35980 35980 35980)
!     ("grey55"		35980 35980 35980)
!     ("gray56"		36751 36751 36751)
!     ("grey56"		36751 36751 36751)
!     ("gray57"		37265 37265 37265)
!     ("grey57"		37265 37265 37265)
!     ("gray58"		38036 38036 38036)
!     ("grey58"		38036 38036 38036)
!     ("gray59"		38550 38550 38550)
!     ("grey59"		38550 38550 38550)
!     ("gray60"		39321 39321 39321)
!     ("grey60"		39321 39321 39321)
!     ("gray61"		40092 40092 40092)
!     ("grey61"		40092 40092 40092)
!     ("gray62"		40606 40606 40606)
!     ("grey62"		40606 40606 40606)
!     ("gray63"		41377 41377 41377)
!     ("grey63"		41377 41377 41377)
!     ("gray64"		41891 41891 41891)
!     ("grey64"		41891 41891 41891)
!     ("gray65"		42662 42662 42662)
!     ("grey65"		42662 42662 42662)
!     ("gray66"		43176 43176 43176)
!     ("grey66"		43176 43176 43176)
!     ("gray67"		43947 43947 43947)
!     ("grey67"		43947 43947 43947)
!     ("gray68"		44461 44461 44461)
!     ("grey68"		44461 44461 44461)
!     ("gray69"		45232 45232 45232)
!     ("grey69"		45232 45232 45232)
!     ("gray70"		46003 46003 46003)
!     ("grey70"		46003 46003 46003)
!     ("gray71"		46517 46517 46517)
!     ("grey71"		46517 46517 46517)
!     ("gray72"		47288 47288 47288)
!     ("grey72"		47288 47288 47288)
!     ("gray73"		47802 47802 47802)
!     ("grey73"		47802 47802 47802)
!     ("gray74"		48573 48573 48573)
!     ("grey74"		48573 48573 48573)
!     ("gray75"		49087 49087 49087)
!     ("grey75"		49087 49087 49087)
!     ("gray76"		49858 49858 49858)
!     ("grey76"		49858 49858 49858)
!     ("gray77"		50372 50372 50372)
!     ("grey77"		50372 50372 50372)
!     ("gray78"		51143 51143 51143)
!     ("grey78"		51143 51143 51143)
!     ("gray79"		51657 51657 51657)
!     ("grey79"		51657 51657 51657)
!     ("gray80"		52428 52428 52428)
!     ("grey80"		52428 52428 52428)
!     ("gray81"		53199 53199 53199)
!     ("grey81"		53199 53199 53199)
!     ("gray82"		53713 53713 53713)
!     ("grey82"		53713 53713 53713)
!     ("gray83"		54484 54484 54484)
!     ("grey83"		54484 54484 54484)
!     ("gray84"		54998 54998 54998)
!     ("grey84"		54998 54998 54998)
!     ("gray85"		55769 55769 55769)
!     ("grey85"		55769 55769 55769)
!     ("gray86"		56283 56283 56283)
!     ("grey86"		56283 56283 56283)
!     ("gray87"		57054 57054 57054)
!     ("grey87"		57054 57054 57054)
!     ("gray88"		57568 57568 57568)
!     ("grey88"		57568 57568 57568)
!     ("gray89"		58339 58339 58339)
!     ("grey89"		58339 58339 58339)
!     ("gray90"		58853 58853 58853)
!     ("grey90"		58853 58853 58853)
!     ("gray91"		59624 59624 59624)
!     ("grey91"		59624 59624 59624)
!     ("gray92"		60395 60395 60395)
!     ("grey92"		60395 60395 60395)
!     ("gray93"		60909 60909 60909)
!     ("grey93"		60909 60909 60909)
!     ("gray94"		61680 61680 61680)
!     ("grey94"		61680 61680 61680)
!     ("gray95"		62194 62194 62194)
!     ("grey95"		62194 62194 62194)
!     ("gray96"		62965 62965 62965)
!     ("grey96"		62965 62965 62965)
!     ("gray97"		63479 63479 63479)
!     ("grey97"		63479 63479 63479)
!     ("gray98"		64250 64250 64250)
!     ("grey98"		64250 64250 64250)
!     ("gray99"		64764 64764 64764)
!     ("grey99"		64764 64764 64764)
!     ("gray100"		65535 65535 65535)
!     ("grey100"		65535 65535 65535)
!     ("darkgrey"		43433 43433 43433)
!     ("darkgray"		43433 43433 43433)
!     ("darkblue"		    0     0 35723)
!     ("darkcyan"		    0 35723 35723) ; no "lightmagenta", see comment above
!     ("darkmagenta"	35723     0 35723)
!     ("darkred"		35723     0     0)  ; but no "lightred", see comment above
!     ("lightgreen"	37008 61166 37008))
    "An alist of X color names and associated 16-bit RGB values.")
  
  (defvar tty-standard-colors
--- 86,748 ----
  ;; of each value are actually identical).
  ;;
  (defvar color-name-rgb-alist
!   '(("snow"             65280 64000 64000)
!     ("ghostwhite"       63488 63488 65280)
!     ("whitesmoke"       62720 62720 62720)
!     ("gainsboro"        56320 56320 56320)
!     ("floralwhite"      65280 64000 61440)
!     ("oldlace"          64768 62720 58880)
!     ("linen"            64000 61440 58880)
!     ("antiquewhite"     64000 60160 55040)
!     ("papayawhip"       65280 61184 54528)
!     ("blanchedalmond"   65280 60160 52480)
!     ("bisque"           65280 58368 50176)
!     ("peachpuff"        65280 55808 47360)
!     ("navajowhite"      65280 56832 44288)
!     ("moccasin"         65280 58368 46336)
!     ("cornsilk"         65280 63488 56320)
!     ("ivory"            65280 65280 61440)
!     ("lemonchiffon"     65280 64000 52480)
!     ("seashell"         65280 62720 60928)
!     ("honeydew"         61440 65280 61440)
!     ("mintcream"        62720 65280 64000)
!     ("azure"            61440 65280 65280)
!     ("aliceblue"        61440 63488 65280)
!     ("lavender"         58880 58880 64000)
!     ("lavenderblush"    65280 61440 62720)
!     ("mistyrose"        65280 58368 57600)
!     ("white"            65280 65280 65280)
!     ("black"                0     0     0)
!     ("darkslategray"    12032 20224 20224)
!     ("darkslategrey"    12032 20224 20224)
!     ("dimgray"          26880 26880 26880)
!     ("dimgrey"          26880 26880 26880)
!     ("slategray"        28672 32768 36864)
!     ("slategrey"        28672 32768 36864)
!     ("lightslategray"   30464 34816 39168)
!     ("lightslategrey"   30464 34816 39168)
!     ("gray"             48640 48640 48640)
!     ("grey"             48640 48640 48640)
!     ("lightgrey"        54016 54016 54016)
!     ("lightgray"        54016 54016 54016)
!     ("midnightblue"      6400  6400 28672)
!     ("navy"                 0     0 32768)
!     ("navyblue"             0     0 32768)
!     ("cornflowerblue"   25600 38144 60672)
!     ("darkslateblue"    18432 15616 35584)
!     ("slateblue"        27136 23040 52480)
!     ("mediumslateblue"  31488 26624 60928)
!     ("lightslateblue"   33792 28672 65280)
!     ("mediumblue"           0     0 52480)
!     ("royalblue"        16640 26880 57600)
!     ("blue"                 0     0 65280)
!     ("dodgerblue"        7680 36864 65280)
!     ("deepskyblue"          0 48896 65280)
!     ("skyblue"          34560 52736 60160)
!     ("lightskyblue"     34560 52736 64000)
!     ("steelblue"        17920 33280 46080)
!     ("lightsteelblue"   45056 50176 56832)
!     ("lightblue"        44288 55296 58880)
!     ("powderblue"       45056 57344 58880)
!     ("paleturquoise"    44800 60928 60928)
!     ("darkturquoise"        0 52736 53504)
!     ("mediumturquoise"  18432 53504 52224)
!     ("turquoise"        16384 57344 53248)
!     ("cyan"                 0 65280 65280)
!     ("lightcyan"        57344 65280 65280)
!     ("cadetblue"        24320 40448 40960)
!     ("mediumaquamarine" 26112 52480 43520)
!     ("aquamarine"       32512 65280 54272)
!     ("darkgreen"            0 25600     0)
!     ("darkolivegreen"   21760 27392 12032)
!     ("darkseagreen"     36608 48128 36608)
!     ("seagreen"         11776 35584 22272)
!     ("mediumseagreen"   15360 45824 28928)
!     ("lightseagreen"     8192 45568 43520)
!     ("palegreen"        38912 64256 38912)
!     ("springgreen"          0 65280 32512)
!     ("lawngreen"        31744 64512     0)
!     ("green"                0 65280     0)
!     ("chartreuse"       32512 65280     0)
!     ("mediumspringgreen"     0 64000 39424)
!     ("greenyellow"      44288 65280 12032)
!     ("limegreen"        12800 52480 12800)
!     ("yellowgreen"      39424 52480 12800)
!     ("forestgreen"       8704 35584  8704)
!     ("olivedrab"        27392 36352  8960)
!     ("darkkhaki"        48384 46848 27392)
!     ("khaki"            61440 58880 35840)
!     ("palegoldenrod"    60928 59392 43520)
!     ("lightgoldenrodyellow" 64000 64000 53760)
!     ("lightyellow"      65280 65280 57344)
!     ("yellow"           65280 65280     0)
!     ("gold"             65280 55040     0)
!     ("lightgoldenrod"   60928 56576 33280)
!     ("goldenrod"        55808 42240  8192)
!     ("darkgoldenrod"    47104 34304  2816)
!     ("rosybrown"        48128 36608 36608)
!     ("indianred"        52480 23552 23552)
!     ("saddlebrown"      35584 17664  4864)
!     ("sienna"           40960 20992 11520)
!     ("peru"             52480 34048 16128)
!     ("burlywood"        56832 47104 34560)
!     ("beige"            62720 62720 56320)
!     ("wheat"            62720 56832 45824)
!     ("sandybrown"       62464 41984 24576)
!     ("tan"              53760 46080 35840)
!     ("chocolate"        53760 26880  7680)
!     ("firebrick"        45568  8704  8704)
!     ("brown"            42240 10752 10752)
!     ("darksalmon"       59648 38400 31232)
!     ("salmon"           64000 32768 29184)
!     ("lightsalmon"      65280 40960 31232)
!     ("orange"           65280 42240     0)
!     ("darkorange"       65280 35840     0)
!     ("coral"            65280 32512 20480)
!     ("lightcoral"       61440 32768 32768)
!     ("tomato"           65280 25344 18176)
!     ("orangered"        65280 17664     0)
!     ("red"              65280     0     0)
!     ("hotpink"          65280 26880 46080)
!     ("deeppink"         65280  5120 37632)
!     ("pink"             65280 49152 51968)
!     ("lightpink"        65280 46592 49408)
!     ("palevioletred"    56064 28672 37632)
!     ("maroon"           45056 12288 24576)
!     ("mediumvioletred"  50944  5376 34048)
!     ("violetred"        53248  8192 36864)
!     ("magenta"          65280     0 65280)
!     ("violet"           60928 33280 60928)
!     ("plum"             56576 40960 56576)
!     ("orchid"           55808 28672 54784)
!     ("mediumorchid"     47616 21760 54016)
!     ("darkorchid"       39168 12800 52224)
!     ("darkviolet"       37888     0 54016)
!     ("blueviolet"       35328 11008 57856)
!     ("purple"           40960  8192 61440)
!     ("mediumpurple"     37632 28672 56064)
!     ("thistle"          55296 48896 55296)
!     ("snow1"            65280 64000 64000)
!     ("snow2"            60928 59648 59648)
!     ("snow3"            52480 51456 51456)
!     ("snow4"            35584 35072 35072)
!     ("seashell1"        65280 62720 60928)
!     ("seashell2"        60928 58624 56832)
!     ("seashell3"        52480 50432 48896)
!     ("seashell4"        35584 34304 33280)
!     ("antiquewhite1"    65280 61184 56064)
!     ("antiquewhite2"    60928 57088 52224)
!     ("antiquewhite3"    52480 49152 45056)
!     ("antiquewhite4"    35584 33536 30720)
!     ("bisque1"          65280 58368 50176)
!     ("bisque2"          60928 54528 46848)
!     ("bisque3"          52480 46848 40448)
!     ("bisque4"          35584 32000 27392)
!     ("peachpuff1"       65280 55808 47360)
!     ("peachpuff2"       60928 51968 44288)
!     ("peachpuff3"       52480 44800 38144)
!     ("peachpuff4"       35584 30464 25856)
!     ("navajowhite1"     65280 56832 44288)
!     ("navajowhite2"     60928 52992 41216)
!     ("navajowhite3"     52480 45824 35584)
!     ("navajowhite4"     35584 30976 24064)
!     ("lemonchiffon1"    65280 64000 52480)
!     ("lemonchiffon2"    60928 59648 48896)
!     ("lemonchiffon3"    52480 51456 42240)
!     ("lemonchiffon4"    35584 35072 28672)
!     ("cornsilk1"        65280 63488 56320)
!     ("cornsilk2"        60928 59392 52480)
!     ("cornsilk3"        52480 51200 45312)
!     ("cornsilk4"        35584 34816 30720)
!     ("ivory1"           65280 65280 61440)
!     ("ivory2"           60928 60928 57344)
!     ("ivory3"           52480 52480 49408)
!     ("ivory4"           35584 35584 33536)
!     ("honeydew1"        61440 65280 61440)
!     ("honeydew2"        57344 60928 57344)
!     ("honeydew3"        49408 52480 49408)
!     ("honeydew4"        33536 35584 33536)
!     ("lavenderblush1"   65280 61440 62720)
!     ("lavenderblush2"   60928 57344 58624)
!     ("lavenderblush3"   52480 49408 50432)
!     ("lavenderblush4"   35584 33536 34304)
!     ("mistyrose1"       65280 58368 57600)
!     ("mistyrose2"       60928 54528 53760)
!     ("mistyrose3"       52480 46848 46336)
!     ("mistyrose4"       35584 32000 31488)
!     ("azure1"           61440 65280 65280)
!     ("azure2"           57344 60928 60928)
!     ("azure3"           49408 52480 52480)
!     ("azure4"           33536 35584 35584)
!     ("slateblue1"       33536 28416 65280)
!     ("slateblue2"       31232 26368 60928)
!     ("slateblue3"       26880 22784 52480)
!     ("slateblue4"       18176 15360 35584)
!     ("royalblue1"       18432 30208 65280)
!     ("royalblue2"       17152 28160 60928)
!     ("royalblue3"       14848 24320 52480)
!     ("royalblue4"        9984 16384 35584)
!     ("blue1"                0     0 65280)
!     ("blue2"                0     0 60928)
!     ("blue3"                0     0 52480)
!     ("blue4"                0     0 35584)
!     ("dodgerblue1"       7680 36864 65280)
!     ("dodgerblue2"       7168 34304 60928)
!     ("dodgerblue3"       6144 29696 52480)
!     ("dodgerblue4"       4096 19968 35584)
!     ("steelblue1"       25344 47104 65280)
!     ("steelblue2"       23552 44032 60928)
!     ("steelblue3"       20224 37888 52480)
!     ("steelblue4"       13824 25600 35584)
!     ("deepskyblue1"         0 48896 65280)
!     ("deepskyblue2"         0 45568 60928)
!     ("deepskyblue3"         0 39424 52480)
!     ("deepskyblue4"         0 26624 35584)
!     ("skyblue1"         34560 52736 65280)
!     ("skyblue2"         32256 49152 60928)
!     ("skyblue3"         27648 42496 52480)
!     ("skyblue4"         18944 28672 35584)
!     ("lightskyblue1"    45056 57856 65280)
!     ("lightskyblue2"    41984 54016 60928)
!     ("lightskyblue3"    36096 46592 52480)
!     ("lightskyblue4"    24576 31488 35584)
!     ("slategray1"       50688 57856 65280)
!     ("slategray2"       47360 54016 60928)
!     ("slategray3"       40704 46592 52480)
!     ("slategray4"       27648 31488 35584)
!     ("lightsteelblue1"  51712 57600 65280)
!     ("lightsteelblue2"  48128 53760 60928)
!     ("lightsteelblue3"  41472 46336 52480)
!     ("lightsteelblue4"  28160 31488 35584)
!     ("lightblue1"       48896 61184 65280)
!     ("lightblue2"       45568 57088 60928)
!     ("lightblue3"       39424 49152 52480)
!     ("lightblue4"       26624 33536 35584)
!     ("lightcyan1"       57344 65280 65280)
!     ("lightcyan2"       53504 60928 60928)
!     ("lightcyan3"       46080 52480 52480)
!     ("lightcyan4"       31232 35584 35584)
!     ("paleturquoise1"   47872 65280 65280)
!     ("paleturquoise2"   44544 60928 60928)
!     ("paleturquoise3"   38400 52480 52480)
!     ("paleturquoise4"   26112 35584 35584)
!     ("cadetblue1"       38912 62720 65280)
!     ("cadetblue2"       36352 58624 60928)
!     ("cadetblue3"       31232 50432 52480)
!     ("cadetblue4"       21248 34304 35584)
!     ("turquoise1"           0 62720 65280)
!     ("turquoise2"           0 58624 60928)
!     ("turquoise3"           0 50432 52480)
!     ("turquoise4"           0 34304 35584)
!     ("cyan1"                0 65280 65280)
!     ("cyan2"                0 60928 60928)
!     ("cyan3"                0 52480 52480)
!     ("cyan4"                0 35584 35584)
!     ("darkslategray1"   38656 65280 65280)
!     ("darkslategray2"   36096 60928 60928)
!     ("darkslategray3"   30976 52480 52480)
!     ("darkslategray4"   20992 35584 35584)
!     ("aquamarine1"      32512 65280 54272)
!     ("aquamarine2"      30208 60928 50688)
!     ("aquamarine3"      26112 52480 43520)
!     ("aquamarine4"      17664 35584 29696)
!     ("darkseagreen1"    49408 65280 49408)
!     ("darkseagreen2"    46080 60928 46080)
!     ("darkseagreen3"    39680 52480 39680)
!     ("darkseagreen4"    26880 35584 26880)
!     ("seagreen1"        21504 65280 40704)
!     ("seagreen2"        19968 60928 37888)
!     ("seagreen3"        17152 52480 32768)
!     ("seagreen4"        11776 35584 22272)
!     ("palegreen1"       39424 65280 39424)
!     ("palegreen2"       36864 60928 36864)
!     ("palegreen3"       31744 52480 31744)
!     ("palegreen4"       21504 35584 21504)
!     ("springgreen1"         0 65280 32512)
!     ("springgreen2"         0 60928 30208)
!     ("springgreen3"         0 52480 26112)
!     ("springgreen4"         0 35584 17664)
!     ("green1"               0 65280     0)
!     ("green2"               0 60928     0)
!     ("green3"               0 52480     0)
!     ("green4"               0 35584     0)
!     ("chartreuse1"      32512 65280     0)
!     ("chartreuse2"      30208 60928     0)
!     ("chartreuse3"      26112 52480     0)
!     ("chartreuse4"      17664 35584     0)
!     ("olivedrab1"       49152 65280 15872)
!     ("olivedrab2"       45824 60928 14848)
!     ("olivedrab3"       39424 52480 12800)
!     ("olivedrab4"       26880 35584  8704)
!     ("darkolivegreen1"  51712 65280 28672)
!     ("darkolivegreen2"  48128 60928 26624)
!     ("darkolivegreen3"  41472 52480 23040)
!     ("darkolivegreen4"  28160 35584 15616)
!     ("khaki1"           65280 62976 36608)
!     ("khaki2"           60928 58880 34048)
!     ("khaki3"           52480 50688 29440)
!     ("khaki4"           35584 34304 19968)
!     ("lightgoldenrod1"  65280 60416 35584)
!     ("lightgoldenrod2"  60928 56320 33280)
!     ("lightgoldenrod3"  52480 48640 28672)
!     ("lightgoldenrod4"  35584 33024 19456)
!     ("lightyellow1"     65280 65280 57344)
!     ("lightyellow2"     60928 60928 53504)
!     ("lightyellow3"     52480 52480 46080)
!     ("lightyellow4"     35584 35584 31232)
!     ("yellow1"          65280 65280     0)
!     ("yellow2"          60928 60928     0)
!     ("yellow3"          52480 52480     0)
!     ("yellow4"          35584 35584     0)
!     ("gold1"            65280 55040     0)
!     ("gold2"            60928 51456     0)
!     ("gold3"            52480 44288     0)
!     ("gold4"            35584 29952     0)
!     ("goldenrod1"       65280 49408  9472)
!     ("goldenrod2"       60928 46080  8704)
!     ("goldenrod3"       52480 39680  7424)
!     ("goldenrod4"       35584 26880  5120)
!     ("darkgoldenrod1"   65280 47360  3840)
!     ("darkgoldenrod2"   60928 44288  3584)
!     ("darkgoldenrod3"   52480 38144  3072)
!     ("darkgoldenrod4"   35584 25856  2048)
!     ("rosybrown1"       65280 49408 49408)
!     ("rosybrown2"       60928 46080 46080)
!     ("rosybrown3"       52480 39680 39680)
!     ("rosybrown4"       35584 26880 26880)
!     ("indianred1"       65280 27136 27136)
!     ("indianred2"       60928 25344 25344)
!     ("indianred3"       52480 21760 21760)
!     ("indianred4"       35584 14848 14848)
!     ("sienna1"          65280 33280 18176)
!     ("sienna2"          60928 30976 16896)
!     ("sienna3"          52480 26624 14592)
!     ("sienna4"          35584 18176  9728)
!     ("burlywood1"       65280 54016 39680)
!     ("burlywood2"       60928 50432 37120)
!     ("burlywood3"       52480 43520 32000)
!     ("burlywood4"       35584 29440 21760)
!     ("wheat1"           65280 59136 47616)
!     ("wheat2"           60928 55296 44544)
!     ("wheat3"           52480 47616 38400)
!     ("wheat4"           35584 32256 26112)
!     ("tan1"             65280 42240 20224)
!     ("tan2"             60928 39424 18688)
!     ("tan3"             52480 34048 16128)
!     ("tan4"             35584 23040 11008)
!     ("chocolate1"       65280 32512  9216)
!     ("chocolate2"       60928 30208  8448)
!     ("chocolate3"       52480 26112  7424)
!     ("chocolate4"       35584 17664  4864)
!     ("firebrick1"       65280 12288 12288)
!     ("firebrick2"       60928 11264 11264)
!     ("firebrick3"       52480  9728  9728)
!     ("firebrick4"       35584  6656  6656)
!     ("brown1"           65280 16384 16384)
!     ("brown2"           60928 15104 15104)
!     ("brown3"           52480 13056 13056)
!     ("brown4"           35584  8960  8960)
!     ("salmon1"          65280 35840 26880)
!     ("salmon2"          60928 33280 25088)
!     ("salmon3"          52480 28672 21504)
!     ("salmon4"          35584 19456 14592)
!     ("lightsalmon1"     65280 40960 31232)
!     ("lightsalmon2"     60928 38144 29184)
!     ("lightsalmon3"     52480 33024 25088)
!     ("lightsalmon4"     35584 22272 16896)
!     ("orange1"          65280 42240     0)
!     ("orange2"          60928 39424     0)
!     ("orange3"          52480 34048     0)
!     ("orange4"          35584 23040     0)
!     ("darkorange1"      65280 32512     0)
!     ("darkorange2"      60928 30208     0)
!     ("darkorange3"      52480 26112     0)
!     ("darkorange4"      35584 17664     0)
!     ("coral1"           65280 29184 22016)
!     ("coral2"           60928 27136 20480)
!     ("coral3"           52480 23296 17664)
!     ("coral4"           35584 15872 12032)
!     ("tomato1"          65280 25344 18176)
!     ("tomato2"          60928 23552 16896)
!     ("tomato3"          52480 20224 14592)
!     ("tomato4"          35584 13824  9728)
!     ("orangered1"       65280 17664     0)
!     ("orangered2"       60928 16384     0)
!     ("orangered3"       52480 14080     0)
!     ("orangered4"       35584  9472     0)
!     ("red1"             65280     0     0)
!     ("red2"             60928     0     0)
!     ("red3"             52480     0     0)
!     ("red4"             35584     0     0)
!     ("deeppink1"        65280  5120 37632)
!     ("deeppink2"        60928  4608 35072)
!     ("deeppink3"        52480  4096 30208)
!     ("deeppink4"        35584  2560 20480)
!     ("hotpink1"         65280 28160 46080)
!     ("hotpink2"         60928 27136 42752)
!     ("hotpink3"         52480 24576 36864)
!     ("hotpink4"         35584 14848 25088)
!     ("pink1"            65280 46336 50432)
!     ("pink2"            60928 43264 47104)
!     ("pink3"            52480 37120 40448)
!     ("pink4"            35584 25344 27648)
!     ("lightpink1"       65280 44544 47360)
!     ("lightpink2"       60928 41472 44288)
!     ("lightpink3"       52480 35840 38144)
!     ("lightpink4"       35584 24320 25856)
!     ("palevioletred1"   65280 33280 43776)
!     ("palevioletred2"   60928 30976 40704)
!     ("palevioletred3"   52480 26624 35072)
!     ("palevioletred4"   35584 18176 23808)
!     ("maroon1"          65280 13312 45824)
!     ("maroon2"          60928 12288 42752)
!     ("maroon3"          52480 10496 36864)
!     ("maroon4"          35584  7168 25088)
!     ("violetred1"       65280 15872 38400)
!     ("violetred2"       60928 14848 35840)
!     ("violetred3"       52480 12800 30720)
!     ("violetred4"       35584  8704 20992)
!     ("magenta1"         65280     0 65280)
!     ("magenta2"         60928     0 60928)
!     ("magenta3"         52480     0 52480)
!     ("magenta4"         35584     0 35584)
!     ("orchid1"          65280 33536 64000)
!     ("orchid2"          60928 31232 59648)
!     ("orchid3"          52480 26880 51456)
!     ("orchid4"          35584 18176 35072)
!     ("plum1"            65280 47872 65280)
!     ("plum2"            60928 44544 60928)
!     ("plum3"            52480 38400 52480)
!     ("plum4"            35584 26112 35584)
!     ("mediumorchid1"    57344 26112 65280)
!     ("mediumorchid2"    53504 24320 60928)
!     ("mediumorchid3"    46080 20992 52480)
!     ("mediumorchid4"    31232 14080 35584)
!     ("darkorchid1"      48896 15872 65280)
!     ("darkorchid2"      45568 14848 60928)
!     ("darkorchid3"      39424 12800 52480)
!     ("darkorchid4"      26624  8704 35584)
!     ("purple1"          39680 12288 65280)
!     ("purple2"          37120 11264 60928)
!     ("purple3"          32000  9728 52480)
!     ("purple4"          21760  6656 35584)
!     ("mediumpurple1"    43776 33280 65280)
!     ("mediumpurple2"    40704 30976 60928)
!     ("mediumpurple3"    35072 26624 52480)
!     ("mediumpurple4"    23808 18176 35584)
!     ("thistle1"         65280 57600 65280)
!     ("thistle2"         60928 53760 60928)
!     ("thistle3"         52480 46336 52480)
!     ("thistle4"         35584 31488 35584)
!     ("gray0"                0     0     0)
!     ("grey0"                0     0     0)
!     ("gray1"              768   768   768)
!     ("grey1"              768   768   768)
!     ("gray2"             1280  1280  1280)
!     ("grey2"             1280  1280  1280)
!     ("gray3"             2048  2048  2048)
!     ("grey3"             2048  2048  2048)
!     ("gray4"             2560  2560  2560)
!     ("grey4"             2560  2560  2560)
!     ("gray5"             3328  3328  3328)
!     ("grey5"             3328  3328  3328)
!     ("gray6"             3840  3840  3840)
!     ("grey6"             3840  3840  3840)
!     ("gray7"             4608  4608  4608)
!     ("grey7"             4608  4608  4608)
!     ("gray8"             5120  5120  5120)
!     ("grey8"             5120  5120  5120)
!     ("gray9"             5888  5888  5888)
!     ("grey9"             5888  5888  5888)
!     ("gray10"            6656  6656  6656)
!     ("grey10"            6656  6656  6656)
!     ("gray11"            7168  7168  7168)
!     ("grey11"            7168  7168  7168)
!     ("gray12"            7936  7936  7936)
!     ("grey12"            7936  7936  7936)
!     ("gray13"            8448  8448  8448)
!     ("grey13"            8448  8448  8448)
!     ("gray14"            9216  9216  9216)
!     ("grey14"            9216  9216  9216)
!     ("gray15"            9728  9728  9728)
!     ("grey15"            9728  9728  9728)
!     ("gray16"           10496 10496 10496)
!     ("grey16"           10496 10496 10496)
!     ("gray17"           11008 11008 11008)
!     ("grey17"           11008 11008 11008)
!     ("gray18"           11776 11776 11776)
!     ("grey18"           11776 11776 11776)
!     ("gray19"           12288 12288 12288)
!     ("grey19"           12288 12288 12288)
!     ("gray20"           13056 13056 13056)
!     ("grey20"           13056 13056 13056)
!     ("gray21"           13824 13824 13824)
!     ("grey21"           13824 13824 13824)
!     ("gray22"           14336 14336 14336)
!     ("grey22"           14336 14336 14336)
!     ("gray23"           15104 15104 15104)
!     ("grey23"           15104 15104 15104)
!     ("gray24"           15616 15616 15616)
!     ("grey24"           15616 15616 15616)
!     ("gray25"           16384 16384 16384)
!     ("grey25"           16384 16384 16384)
!     ("gray26"           16896 16896 16896)
!     ("grey26"           16896 16896 16896)
!     ("gray27"           17664 17664 17664)
!     ("grey27"           17664 17664 17664)
!     ("gray28"           18176 18176 18176)
!     ("grey28"           18176 18176 18176)
!     ("gray29"           18944 18944 18944)
!     ("grey29"           18944 18944 18944)
!     ("gray30"           19712 19712 19712)
!     ("grey30"           19712 19712 19712)
!     ("gray31"           20224 20224 20224)
!     ("grey31"           20224 20224 20224)
!     ("gray32"           20992 20992 20992)
!     ("grey32"           20992 20992 20992)
!     ("gray33"           21504 21504 21504)
!     ("grey33"           21504 21504 21504)
!     ("gray34"           22272 22272 22272)
!     ("grey34"           22272 22272 22272)
!     ("gray35"           22784 22784 22784)
!     ("grey35"           22784 22784 22784)
!     ("gray36"           23552 23552 23552)
!     ("grey36"           23552 23552 23552)
!     ("gray37"           24064 24064 24064)
!     ("grey37"           24064 24064 24064)
!     ("gray38"           24832 24832 24832)
!     ("grey38"           24832 24832 24832)
!     ("gray39"           25344 25344 25344)
!     ("grey39"           25344 25344 25344)
!     ("gray40"           26112 26112 26112)
!     ("grey40"           26112 26112 26112)
!     ("gray41"           26880 26880 26880)
!     ("grey41"           26880 26880 26880)
!     ("gray42"           27392 27392 27392)
!     ("grey42"           27392 27392 27392)
!     ("gray43"           28160 28160 28160)
!     ("grey43"           28160 28160 28160)
!     ("gray44"           28672 28672 28672)
!     ("grey44"           28672 28672 28672)
!     ("gray45"           29440 29440 29440)
!     ("grey45"           29440 29440 29440)
!     ("gray46"           29952 29952 29952)
!     ("grey46"           29952 29952 29952)
!     ("gray47"           30720 30720 30720)
!     ("grey47"           30720 30720 30720)
!     ("gray48"           31232 31232 31232)
!     ("grey48"           31232 31232 31232)
!     ("gray49"           32000 32000 32000)
!     ("grey49"           32000 32000 32000)
!     ("gray50"           32512 32512 32512)
!     ("grey50"           32512 32512 32512)
!     ("gray51"           33280 33280 33280)
!     ("grey51"           33280 33280 33280)
!     ("gray52"           34048 34048 34048)
!     ("grey52"           34048 34048 34048)
!     ("gray53"           34560 34560 34560)
!     ("grey53"           34560 34560 34560)
!     ("gray54"           35328 35328 35328)
!     ("grey54"           35328 35328 35328)
!     ("gray55"           35840 35840 35840)
!     ("grey55"           35840 35840 35840)
!     ("gray56"           36608 36608 36608)
!     ("grey56"           36608 36608 36608)
!     ("gray57"           37120 37120 37120)
!     ("grey57"           37120 37120 37120)
!     ("gray58"           37888 37888 37888)
!     ("grey58"           37888 37888 37888)
!     ("gray59"           38400 38400 38400)
!     ("grey59"           38400 38400 38400)
!     ("gray60"           39168 39168 39168)
!     ("grey60"           39168 39168 39168)
!     ("gray61"           39936 39936 39936)
!     ("grey61"           39936 39936 39936)
!     ("gray62"           40448 40448 40448)
!     ("grey62"           40448 40448 40448)
!     ("gray63"           41216 41216 41216)
!     ("grey63"           41216 41216 41216)
!     ("gray64"           41728 41728 41728)
!     ("grey64"           41728 41728 41728)
!     ("gray65"           42496 42496 42496)
!     ("grey65"           42496 42496 42496)
!     ("gray66"           43008 43008 43008)
!     ("grey66"           43008 43008 43008)
!     ("gray67"           43776 43776 43776)
!     ("grey67"           43776 43776 43776)
!     ("gray68"           44288 44288 44288)
!     ("grey68"           44288 44288 44288)
!     ("gray69"           45056 45056 45056)
!     ("grey69"           45056 45056 45056)
!     ("gray70"           45824 45824 45824)
!     ("grey70"           45824 45824 45824)
!     ("gray71"           46336 46336 46336)
!     ("grey71"           46336 46336 46336)
!     ("gray72"           47104 47104 47104)
!     ("grey72"           47104 47104 47104)
!     ("gray73"           47616 47616 47616)
!     ("grey73"           47616 47616 47616)
!     ("gray74"           48384 48384 48384)
!     ("grey74"           48384 48384 48384)
!     ("gray75"           48896 48896 48896)
!     ("grey75"           48896 48896 48896)
!     ("gray76"           49664 49664 49664)
!     ("grey76"           49664 49664 49664)
!     ("gray77"           50176 50176 50176)
!     ("grey77"           50176 50176 50176)
!     ("gray78"           50944 50944 50944)
!     ("grey78"           50944 50944 50944)
!     ("gray79"           51456 51456 51456)
!     ("grey79"           51456 51456 51456)
!     ("gray80"           52224 52224 52224)
!     ("grey80"           52224 52224 52224)
!     ("gray81"           52992 52992 52992)
!     ("grey81"           52992 52992 52992)
!     ("gray82"           53504 53504 53504)
!     ("grey82"           53504 53504 53504)
!     ("gray83"           54272 54272 54272)
!     ("grey83"           54272 54272 54272)
!     ("gray84"           54784 54784 54784)
!     ("grey84"           54784 54784 54784)
!     ("gray85"           55552 55552 55552)
!     ("grey85"           55552 55552 55552)
!     ("gray86"           56064 56064 56064)
!     ("grey86"           56064 56064 56064)
!     ("gray87"           56832 56832 56832)
!     ("grey87"           56832 56832 56832)
!     ("gray88"           57344 57344 57344)
!     ("grey88"           57344 57344 57344)
!     ("gray89"           58112 58112 58112)
!     ("grey89"           58112 58112 58112)
!     ("gray90"           58624 58624 58624)
!     ("grey90"           58624 58624 58624)
!     ("gray91"           59392 59392 59392)
!     ("grey91"           59392 59392 59392)
!     ("gray92"           60160 60160 60160)
!     ("grey92"           60160 60160 60160)
!     ("gray93"           60672 60672 60672)
!     ("grey93"           60672 60672 60672)
!     ("gray94"           61440 61440 61440)
!     ("grey94"           61440 61440 61440)
!     ("gray95"           61952 61952 61952)
!     ("grey95"           61952 61952 61952)
!     ("gray96"           62720 62720 62720)
!     ("grey96"           62720 62720 62720)
!     ("gray97"           63232 63232 63232)
!     ("grey97"           63232 63232 63232)
!     ("gray98"           64000 64000 64000)
!     ("grey98"           64000 64000 64000)
!     ("gray99"           64512 64512 64512)
!     ("grey99"           64512 64512 64512)
!     ("gray100"          65280 65280 65280)
!     ("grey100"          65280 65280 65280)
!     ("darkgrey"         43264 43264 43264)
!     ("darkgray"         43264 43264 43264)
!     ("darkblue"             0     0 35584)
!     ("darkcyan"             0 35584 35584) ; no "lightmagenta", see comment above
!     ("darkmagenta"      35584     0 35584)
!     ("darkred"          35584     0     0) ; but no "lightred", see comment above
!     ("lightgreen"       36864 60928 36864))
    "An alist of X color names and associated 16-bit RGB values.")
  
  (defvar tty-standard-colors

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-06 23:50       ` Dan Nicolaescu
@ 2005-04-07  0:22         ` David Kastrup
  2005-04-07  3:58           ` Eli Zaretskii
  2005-04-07  5:14           ` Dan Nicolaescu
  2005-04-07  3:55         ` Eli Zaretskii
  1 sibling, 2 replies; 22+ messages in thread
From: David Kastrup @ 2005-04-07  0:22 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

> "Eli Zaretskii" <eliz@gnu.org> writes:
>
>   > > Cc: emacs-devel@gnu.org
>   > > From: Dan Nicolaescu <dann@ics.uci.edu>
>   > > Date: Wed, 06 Apr 2005 10:52:26 -0700
>   > > 
>   > > Agreed. The problem seems to be that tty-colors.el and color-name-rgb-alist
>   > > don't use the same of scaling. 
>   > > Do you want me to do check if rescaling the values in
>   > > color-name-rgb-alist gives good results?
>   > 
>   > Yes, please.
>
> I checked and I could not see any difference in behavior compared to the
> approach in my first patch.
>
> Is this OK? 

I am certain I am missing the context, but is this really related to
the #RRGGBB notation in any manner?  It really looks awful to me if
white gets defined as #ff00ff00ff00, so I'd like to be as bothersome
as to be grateful for some factual reassurance that we are indeed
catering here for a real instead of a perceived problem, and that the
fix in that manner is the right thing to do.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
       [not found]   ` <200504062134.j36LY8AH022227@scanner2.ics.uci.edu>
@ 2005-04-07  3:53     ` Eli Zaretskii
  2005-04-07 18:27       ` Dan Nicolaescu
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2005-04-07  3:53 UTC (permalink / raw)
  Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Wed, 06 Apr 2005 14:34:06 -0700
> 
> "Eli Zaretskii" <eliz@gnu.org> writes:
> 
>   > > From: Dan Nicolaescu <dann@ics.uci.edu>
>   > > Some standard face definitions use colors like "red" or "blue". They 
>   > > should be changed "red1" (or "blue1")
>   > 
>   > Yes, I agree.  Can you post a patch to do that?
> 
> Here it is. It replaces: 
> 	red->red1
> 	green->green1
> 	blue->blue1
> 	yellow->yellow1
> 	cyan->cyan1
> 	magenta->magenta1
> 
> The replacements were done so that not change anything for faces that
> had a special treatment for ttys, pc, etc. 

Thanks.

> Is this OK? 
> 
> Index: lisp/comint.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/comint.el,v
> retrieving revision 1.310
> diff -c -3 -p -r1.310 comint.el
> *** lisp/comint.el	5 Apr 2005 01:21:23 -0000	1.310
> --- lisp/comint.el	6 Apr 2005 21:24:52 -0000
> *************** This variable is buffer-local."
> *** 228,234 ****
>     :group 'comint)
>   
>   (defface comint-highlight-prompt
> !   '((((background dark)) (:foreground "cyan"))
>       (t (:foreground "dark blue")))
>     "Face to use to highlight prompts."
>     :group 'comint)
> --- 228,234 ----
>     :group 'comint)
>   
>   (defface comint-highlight-prompt
> !   '((((background dark)) (:foreground "cyan1"))
>       (t (:foreground "dark blue")))
>     "Face to use to highlight prompts."
>     :group 'comint)

Hmmm... "bother", as they say.  The changes to the face colors that
are under (min-colors 88) or when there's a separate color for less
color-capable displays are okay.  But there are few cases where
there's a single color definition, like the one above, which is
applicable to all color-capable displays.  In these cases, the changes
you suggest will have a significant effect on 16-color text terminals,
because cyan1, blue1, red1 etc. are translated to the bright shades of
the respective colors, so what was red will now be brightred.  The
bright shades are quite annoying in many situations.

So I think we should change this patch so as not to change the color
definitions on displays that support less than 88 colors.  That is, in
those cases where there's a single color definition, split it into 2
and change only the one for >88 colors.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-06 23:50       ` Dan Nicolaescu
  2005-04-07  0:22         ` David Kastrup
@ 2005-04-07  3:55         ` Eli Zaretskii
  1 sibling, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2005-04-07  3:55 UTC (permalink / raw)
  Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Wed, 06 Apr 2005 16:50:07 -0700
> 
> I checked and I could not see any difference in behavior compared to the
> approach in my first patch.
> 
> Is this OK? 

Fine with me, but please respond to David's concerns.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-07  0:22         ` David Kastrup
@ 2005-04-07  3:58           ` Eli Zaretskii
  2005-04-07  5:14           ` Dan Nicolaescu
  1 sibling, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2005-04-07  3:58 UTC (permalink / raw)
  Cc: dann, emacs-devel

> Cc: Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org
> From: David Kastrup <dak@gnu.org>
> Date: Thu, 07 Apr 2005 02:22:26 +0200
> 
> > I checked and I could not see any difference in behavior compared to the
> > approach in my first patch.
> >
> > Is this OK? 
> 
> I am certain I am missing the context, but is this really related to
> the #RRGGBB notation in any manner?  It really looks awful to me if
> white gets defined as #ff00ff00ff00, so I'd like to be as bothersome
> as to be grateful for some factual reassurance that we are indeed
> catering here for a real instead of a perceived problem, and that the
> fix in that manner is the right thing to do.

I'll let Dan answer that.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-07  0:22         ` David Kastrup
  2005-04-07  3:58           ` Eli Zaretskii
@ 2005-04-07  5:14           ` Dan Nicolaescu
  2005-04-07 10:23             ` David Kastrup
  1 sibling, 1 reply; 22+ messages in thread
From: Dan Nicolaescu @ 2005-04-07  5:14 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

David Kastrup <dak@gnu.org> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > 
  > > "Eli Zaretskii" <eliz@gnu.org> writes:
  > >
  > >   > > Cc: emacs-devel@gnu.org
  > >   > > From: Dan Nicolaescu <dann@ics.uci.edu>
  > >   > > Date: Wed, 06 Apr 2005 10:52:26 -0700
  > >   > > 
  > >   > > Agreed. The problem seems to be that tty-colors.el and color-name-rgb-alist
  > >   > > don't use the same of scaling. 
  > >   > > Do you want me to do check if rescaling the values in
  > >   > > color-name-rgb-alist gives good results?
  > >   > 
  > >   > Yes, please.
  > >
  > > I checked and I could not see any difference in behavior compared to the
  > > approach in my first patch.
  > >
  > > Is this OK? 
  > 
  > I am certain I am missing the context, but is this really related to
  > the #RRGGBB notation in any manner?  It really looks awful to me if
  > white gets defined as #ff00ff00ff00, so I'd like to be as bothersome
  > as to be grateful for some factual reassurance that we are indeed
  > catering here for a real instead of a perceived problem, and that the
  > fix in that manner is the right thing to do.

Well,  there patch has 3 parts. 

Part1:
The patch to xterm-register-default-colors changes the way the 8bit
R/G/B values are computed for a 256 color xterm to match what the
xterm currently does. This part should be correct and
non-controversial.

Part2:
xterm-rgb-convert-to-16bit converts an 8bit color value (say Y) to a 16bit
color. As we discussed, the result can either be Y0 or YY.
My empirical testing show that there's no visible difference between
the two. 
I have no opinion which is better, if any.
Eli seems to think that Y0 is the correct conversion, I don't have a
problem going with that. (although "esthetically" YY looks better).

Part3:
color-name-rgb-alist contains the colors in rgb.txt converted to
16bit. It should use the same conversion as
xterm-rgb-convert-to-16bit. So this part is only needed if the
conversion performed by xterm-rgb-convert-to-16bit is Y->Y0.
(Hmmm, if the Y->Y0 conversion is used then
pc-win.el:msdos-color-values needs to be changed in the same way). 

So when a final decision is made about using the YY or Y0 conversion I
can check in the corresponding patch.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-07  5:14           ` Dan Nicolaescu
@ 2005-04-07 10:23             ` David Kastrup
  2005-04-08  1:13               ` Dan Nicolaescu
  0 siblings, 1 reply; 22+ messages in thread
From: David Kastrup @ 2005-04-07 10:23 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

> David Kastrup <dak@gnu.org> writes:
>
>   > I am certain I am missing the context, but is this really
>   > related to the #RRGGBB notation in any manner?  It really looks
>   > awful to me if white gets defined as #ff00ff00ff00, so I'd like
>   > to be as bothersome as to be grateful for some factual
>   > reassurance that we are indeed catering here for a real instead
>   > of a perceived problem, and that the fix in that manner is the
>   > right thing to do.
>
> Well,  there patch has 3 parts. 
>
> Part1:
> The patch to xterm-register-default-colors changes the way the 8bit
> R/G/B values are computed for a 256 color xterm to match what the
> xterm currently does. This part should be correct and
> non-controversial.

Ok.

> Part2:
> xterm-rgb-convert-to-16bit converts an 8bit color value (say Y) to a 16bit
> color. As we discussed, the result can either be Y0 or YY.
> My empirical testing show that there's no visible difference between
> the two. 

If by "visible" you mean "undiscernible by the unadorned eye as long
as no gamma correction is applied", sure.  If by "visible" you mean
"undiscernible by the computer so that the heuristic-mask image
property has a chance of working with an explicit color", we are
talking something entirely different here.

man Xcolor:

[...]

STRUCTURES
	The XColor structure contains:

	typedef struct {
		unsigned long pixel; /* pixel value */
		unsigned short red, green, blue; /* rgb values */
		char flags;         /* DoRed, DoGreen, DoBlue */ 
		char pad;
	} XColor;

	The red, green, and blue values are always in the range 0 to
	65535 inclusive, independent of the number of bits actually
	used in the display hardware.  The server scales these
	values down to the range used by the hardware.  Black is
	represented by (0,0,0),  and white is represented by
	(65535,65535,65535).  In some functions, the flags member
        ^^^^^^^^^^^^^^^^^^^
	controls which of the red, green, and blue members is used
	and can be the inclusive OR of zero or more of DoRed,
	DoGreen, and  DoBlue.

I think it would be appropriate to use the same algorithm as
XParseColor would use on rgb:rrrr/gggg/bbbb: this is explicitly
described as the sort of scaled type that is also in the XColor manual
page.

The XColor manual page explicitly deprecates #rgb notation.

You can also look into

<URL:http://cvs.freedesktop.org/xorg/xc/lib/X11/XRGB.c?view=markup>

to see how they convert colors there.

To quote:

void
_XcmsResolveColor(
    XcmsCCC ccc,
    XcmsColor *pXcmsColor)
/*
 *	DESCRIPTION
 *	    Uses the X Server ResolveColor() algorithm to
 *	    modify values to closest values supported by hardware.
 *	    Old algorithm simply masked low-order bits.  The new algorithm
 *	    has the effect of replicating significant bits into lower order
 *	    bits in order to stretch the hardware value into all 16 bits.
 *
 *	    On a display with N-bit DACs, the "hardware" color is computed as:
 *
 *	    ((unsignedlong)(ClientValue >> (16-N)) * 0xFFFF) / ((1 << N) - 1)
 *		
 *
 *	RETURNS
 *		void.
 */

Now I can't promise that this is the absolutely canonical file for
this functionality: it is what I came across first when trying to
browse the X11 CVS.  It is likely that there are more relevant files
around.  If anybody has the X11 source on his computer, it would
appear that grepping for ResolveColor might be a good idae.

> Part3:
> color-name-rgb-alist contains the colors in rgb.txt converted to
> 16bit. It should use the same conversion as
> xterm-rgb-convert-to-16bit.

I think it should deliver the same results as XParseColor does, right?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-07  3:53     ` Eli Zaretskii
@ 2005-04-07 18:27       ` Dan Nicolaescu
  2005-04-08 10:54         ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Dan Nicolaescu @ 2005-04-07 18:27 UTC (permalink / raw)
  Cc: emacs-devel

"Eli Zaretskii" <eliz@gnu.org> writes:

  > > Cc: emacs-devel@gnu.org
  > > From: Dan Nicolaescu <dann@ics.uci.edu>
  > 
  > Hmmm... "bother", as they say.  The changes to the face colors that
  > are under (min-colors 88) or when there's a separate color for less
  > color-capable displays are okay.  But there are few cases where
  > there's a single color definition, like the one above, which is
  > applicable to all color-capable displays.  In these cases, the changes
  > you suggest will have a significant effect on 16-color text terminals,
  > because cyan1, blue1, red1 etc. are translated to the bright shades of
  > the respective colors, so what was red will now be brightred.  The
  > bright shades are quite annoying in many situations.
  >
  > 
  > So I think we should change this patch so as not to change the color
  > definitions on displays that support less than 88 colors.  That is, in
  > those cases where there's a single color definition, split it into 2
  > and change only the one for >88 colors.

OK, I did this, except for a few faces that are supposed to stand out
by design, for those using the brighter colors seemed more appropriate
for 16-colore terminals too. These faces are:  custom-invalid-face
trailing-whitespace, c-invalid-face-name, whitespace-highlight-face.

Index: comint.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/comint.el,v
retrieving revision 1.310
diff -c -3 -p -r1.310 comint.el
*** comint.el	5 Apr 2005 01:21:23 -0000	1.310
--- comint.el	7 Apr 2005 18:16:38 -0000
*************** This variable is buffer-local."
*** 228,234 ****
    :group 'comint)
  
  (defface comint-highlight-prompt
!   '((((background dark)) (:foreground "cyan"))
      (t (:foreground "dark blue")))
    "Face to use to highlight prompts."
    :group 'comint)
--- 228,235 ----
    :group 'comint)
  
  (defface comint-highlight-prompt
!   '(((min-colors 88) ((background dark)) (:foreground "cyan1"))
!     (((background dark)) (:foreground "cyan"))
      (t (:foreground "dark blue")))
    "Face to use to highlight prompts."
    :group 'comint)
Index: cus-edit.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/cus-edit.el,v
retrieving revision 1.217
diff -c -3 -p -r1.217 cus-edit.el
*** cus-edit.el	5 Apr 2005 06:40:12 -0000	1.217
--- cus-edit.el	7 Apr 2005 18:16:38 -0000
*************** item in another window.\n\n"))
*** 1633,1639 ****
    :group 'custom-buffer)
  
  (defface custom-invalid-face '((((class color))
! 				(:foreground "yellow" :background "red"))
  			       (t
  				(:weight bold :slant italic :underline t)))
    "Face used when the customize item is invalid."
--- 1633,1639 ----
    :group 'custom-buffer)
  
  (defface custom-invalid-face '((((class color))
! 				(:foreground "yellow1" :background "red1"))
  			       (t
  				(:weight bold :slant italic :underline t)))
    "Face used when the customize item is invalid."
*************** item in another window.\n\n"))
*** 1646,1666 ****
    "Face used when the customize item is not defined for customization."
    :group 'custom-magic-faces)
  
! (defface custom-modified-face '((((class color))
  				 (:foreground "white" :background "blue"))
  				(t
  				 (:slant italic :bold)))
    "Face used when the customize item has been modified."
    :group 'custom-magic-faces)
  
! (defface custom-set-face '((((class color))
  			    (:foreground "blue" :background "white"))
  			   (t
  			    (:slant italic)))
    "Face used when the customize item has been set."
    :group 'custom-magic-faces)
  
! (defface custom-changed-face '((((class color))
  				(:foreground "white" :background "blue"))
  			       (t
  				(:slant italic)))
--- 1646,1672 ----
    "Face used when the customize item is not defined for customization."
    :group 'custom-magic-faces)
  
! (defface custom-modified-face '(((min-colors 88) ((class color))
! 				 (:foreground "white" :background "blue1"))
! 				(((class color))
  				 (:foreground "white" :background "blue"))
  				(t
  				 (:slant italic :bold)))
    "Face used when the customize item has been modified."
    :group 'custom-magic-faces)
  
! (defface custom-set-face '((((min-colors 88) (class color))
! 			    (:foreground "blue1" :background "white"))
! 			   (((class color))
  			    (:foreground "blue" :background "white"))
  			   (t
  			    (:slant italic)))
    "Face used when the customize item has been set."
    :group 'custom-magic-faces)
  
! (defface custom-changed-face '((((min-colors 88) (class color))
! 				(:foreground "white" :background "blue1"))
! 			       (((class color))
  				(:foreground "white" :background "blue"))
  			       (t
  				(:slant italic)))
*************** If INITIAL-STRING is non-nil, use that r
*** 2148,2156 ****
    `((((class color)
        (background dark))
       (:foreground "light blue" :weight bold :height 1.2 :inherit variable-pitch))
      (((class color)
        (background light))
!      (:foreground "blue" :weight bold :height 1.2 :inherit variable-pitch))
      (t (:weight bold)))
    "Face used for unpushable variable tags."
    :group 'custom-faces)
--- 2154,2165 ----
    `((((class color)
        (background dark))
       (:foreground "light blue" :weight bold :height 1.2 :inherit variable-pitch))
+     (((min-colors 88) (class color)
+       (background light))
+      (:foreground "blue1" :weight bold :height 1.2 :inherit variable-pitch))
      (((class color)
        (background light))
!      (:foreground "blue" :weight bold :height 1.2 :inherit variable-pitch))    
      (t (:weight bold)))
    "Face used for unpushable variable tags."
    :group 'custom-faces)
*************** and so forth.  The remaining group tags 
*** 3392,3397 ****
--- 3401,3409 ----
    `((((class color)
        (background dark))
       (:foreground "pink" :weight bold :height 1.2 :inherit variable-pitch))
+     (((min-colors 88) (class color)
+       (background light))
+      (:foreground "red1" :weight bold :height 1.2 :inherit variable-pitch))
      (((class color)
        (background light))
       (:foreground "red" :weight bold :height 1.2 :inherit variable-pitch))
*************** and so forth.  The remaining group tags 
*** 3403,3408 ****
--- 3415,3423 ----
    `((((class color)
        (background dark))
       (:foreground "light blue" :weight bold :height 1.2))
+     (((min-colors 88) (class color)
+       (background light))
+      (:foreground "blue1" :weight bold :height 1.2))
      (((class color)
        (background light))
       (:foreground "blue" :weight bold :height 1.2))
Index: font-lock.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/font-lock.el,v
retrieving revision 1.236
diff -c -3 -p -r1.236 font-lock.el
*** font-lock.el	28 Mar 2005 16:45:43 -0000	1.236
--- font-lock.el	7 Apr 2005 18:16:38 -0000
*************** Sets various variables using `font-lock-
*** 1657,1663 ****
    '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
      (((class color) (min-colors 88) (background light)) (:foreground "Purple"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Cyan"))
      (((class color) (min-colors 16) (background light)) (:foreground "Purple"))
      (((class color) (min-colors 16) (background dark)) (:foreground "Cyan"))
      (((class color) (min-colors 8)) (:foreground "cyan" :weight bold))
--- 1657,1663 ----
    '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
      (((class color) (min-colors 88) (background light)) (:foreground "Purple"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Cyan1"))
      (((class color) (min-colors 16) (background light)) (:foreground "Purple"))
      (((class color) (min-colors 16) (background dark)) (:foreground "Cyan"))
      (((class color) (min-colors 8)) (:foreground "cyan" :weight bold))
*************** Sets various variables using `font-lock-
*** 1678,1684 ****
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-function-name-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Blue"))
      (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
      (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
      (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
--- 1678,1684 ----
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-function-name-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
      (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
      (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
      (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
*************** Sets various variables using `font-lock-
*** 1728,1734 ****
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-warning-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Red" :weight bold))
      (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
      (((class color) (min-colors 16) (background light)) (:foreground "Red" :weight bold))
      (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))
--- 1728,1734 ----
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-warning-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Red1" :weight bold))
      (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
      (((class color) (min-colors 16) (background light)) (:foreground "Red" :weight bold))
      (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))
Index: generic-x.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/generic-x.el,v
retrieving revision 1.29
diff -c -3 -p -r1.29 generic-x.el
*** generic-x.el	5 Apr 2005 18:33:50 -0000	1.29
--- generic-x.el	7 Apr 2005 18:16:38 -0000
*************** generic-x to enable the specified modes.
*** 1612,1619 ****
  (defface show-tabs-tab-face
    '((((class grayscale) (background light)) (:background "DimGray"   :weight bold))
      (((class grayscale) (background dark))  (:background "LightGray" :weight bold))
!     (((class color)     (background light)) (:background "red"))
!     (((class color)     (background dark))  (:background "red"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight TABs."
    :group 'generic-x)
--- 1612,1619 ----
  (defface show-tabs-tab-face
    '((((class grayscale) (background light)) (:background "DimGray"   :weight bold))
      (((class grayscale) (background dark))  (:background "LightGray" :weight bold))
!     (((class color)     (min-colors 88))    (:background "red1"))
!     (((class color))                        (:background "red"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight TABs."
    :group 'generic-x)
*************** generic-x to enable the specified modes.
*** 1621,1628 ****
  (defface show-tabs-space-face
    '((((class grayscale) (background light)) (:background "DimGray"   :weight bold))
      (((class grayscale) (background dark))  (:background "LightGray" :weight bold))
!     (((class color)     (background light)) (:background "yellow"))
!     (((class color)     (background dark))  (:background "yellow"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight spaces."
    :group 'generic-x)
--- 1621,1628 ----
  (defface show-tabs-space-face
    '((((class grayscale) (background light)) (:background "DimGray"   :weight bold))
      (((class grayscale) (background dark))  (:background "LightGray" :weight bold))
!     (((class color)     (min-colors 88))    (:background "yellow1"))
!     (((class color))                        (:background "yellow"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight spaces."
    :group 'generic-x)
Index: hi-lock.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/hi-lock.el,v
retrieving revision 1.21
diff -c -3 -p -r1.21 hi-lock.el
*** hi-lock.el	24 Mar 2005 22:12:00 -0000	1.21
--- hi-lock.el	7 Apr 2005 18:16:38 -0000
*************** calls."
*** 119,125 ****
    :group 'hi-lock-interactive-text-highlighting)
  
  (defface hi-yellow
!   '((((background dark)) (:background "yellow" :foreground "black"))
      (t (:background "yellow")))
    "Default face for hi-lock mode."
    :group 'hi-lock-faces)
--- 119,128 ----
    :group 'hi-lock-interactive-text-highlighting)
  
  (defface hi-yellow
!   '((((min-colors 88) (background dark)) 
!      (:background "yellow1" :foreground "black"))
!     (((background dark)) (:background "yellow" :foreground "black"))
!     (((min-colors 88)) (:background "yellow1"))
      (t (:background "yellow")))
    "Default face for hi-lock mode."
    :group 'hi-lock-faces)
*************** calls."
*** 131,137 ****
    :group 'hi-lock-faces)
  
  (defface hi-green
!   '((((background dark)) (:background "green" :foreground "black"))
      (t (:background "green")))
    "Face for hi-lock mode."
    :group 'hi-lock-faces)
--- 134,143 ----
    :group 'hi-lock-faces)
  
  (defface hi-green
!   '((((min-colors 88) (background dark)) 
!      (:background "green1" :foreground "black"))
!     (((background dark)) (:background "green" :foreground "black"))
!     ((min-colors 88) (:background "green1"))
      (t (:background "green")))
    "Face for hi-lock mode."
    :group 'hi-lock-faces)
*************** calls."
*** 148,164 ****
    :group 'hi-lock-faces)
  
  (defface hi-blue-b
!   '((t (:weight bold :foreground "blue")))
    "Face for hi-lock mode."
    :group 'hi-lock-faces)
  
  (defface hi-green-b
!   '((t (:weight bold :foreground "green")))
    "Face for hi-lock mode."
    :group 'hi-lock-faces)
  
  (defface hi-red-b
!   '((t (:weight bold :foreground "red")))
    "Face for hi-lock mode."
    :group 'hi-lock-faces)
  
--- 154,173 ----
    :group 'hi-lock-faces)
  
  (defface hi-blue-b
!   '((((min-colors 88)) (:weight bold :foreground "blue1"))
!     (t (:weight bold :foreground "blue")))
    "Face for hi-lock mode."
    :group 'hi-lock-faces)
  
  (defface hi-green-b
!   '((((min-colors 88)) (:weight bold :foreground "green1"))
!     (t (:weight bold :foreground "green")))
    "Face for hi-lock mode."
    :group 'hi-lock-faces)
  
  (defface hi-red-b
!   '((((min-colors 88)) (:weight bold :foreground "red1"))
!     (t (:weight bold :foreground "red")))
    "Face for hi-lock mode."
    :group 'hi-lock-faces)
  
Index: hilit-chg.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/hilit-chg.el,v
retrieving revision 1.27
diff -c -3 -p -r1.27 hilit-chg.el
*** hilit-chg.el	24 Mar 2005 22:13:39 -0000	1.27
--- hilit-chg.el	7 Apr 2005 18:16:38 -0000
***************
*** 213,226 ****
  ;; indentation on inserts gets underlined (which can look pretty ugly!).
  
  (defface highlight-changes-face
!   '((((class color)) (:foreground "red" ))
      (t (:inverse-video t)))
    "Face used for highlighting changes."
    :group 'highlight-changes)
  
  ;; This looks pretty ugly, actually.  Maybe the underline should be removed.
  (defface highlight-changes-delete-face
!   '((((class color)) (:foreground "red" :underline t))
      (t (:inverse-video t)))
    "Face used for highlighting deletions."
    :group 'highlight-changes)
--- 213,228 ----
  ;; indentation on inserts gets underlined (which can look pretty ugly!).
  
  (defface highlight-changes-face
!   '((((min-colors 88) (class color)) (:foreground "red1" ))
!     (((class color)) (:foreground "red" ))
      (t (:inverse-video t)))
    "Face used for highlighting changes."
    :group 'highlight-changes)
  
  ;; This looks pretty ugly, actually.  Maybe the underline should be removed.
  (defface highlight-changes-delete-face
!   '((((min-colors 88) (class color)) (:foreground "red1" :underline t))
!     (((class color)) (:foreground "red" :underline t))
      (t (:inverse-video t)))
    "Face used for highlighting deletions."
    :group 'highlight-changes)
Index: ido.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ido.el,v
retrieving revision 1.49
diff -c -3 -p -r1.49 ido.el
*** ido.el	31 Mar 2005 22:22:45 -0000	1.49
--- ido.el	7 Apr 2005 18:16:39 -0000
*************** subdirs in the alternatives."
*** 747,759 ****
    "*Font used by ido for highlighting only match."
    :group 'ido)
  
! (defface ido-subdir-face  '((((class color))
                               (:foreground "red"))
                              (t (:underline t)))
    "*Font used by ido for highlighting subdirs in the alternatives."
    :group 'ido)
  
! (defface ido-indicator-face  '((((class color))
  				(:foreground "yellow"
  				 :background "red"
  				 :width condensed))
--- 747,765 ----
    "*Font used by ido for highlighting only match."
    :group 'ido)
  
! (defface ido-subdir-face  '((((min-colors 88) (class color))
!                              (:foreground "red1"))
! 			    (((class color))
                               (:foreground "red"))
                              (t (:underline t)))
    "*Font used by ido for highlighting subdirs in the alternatives."
    :group 'ido)
  
! (defface ido-indicator-face  '((((min-colors 88) (class color))
! 				(:foreground "yellow1"
! 				 :background "red1"
! 				 :width condensed))
! 			       (((class color))
  				(:foreground "yellow"
  				 :background "red"
  				 :width condensed))
Index: info.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/info.el,v
retrieving revision 1.423
diff -c -3 -p -r1.423 info.el
*** info.el	7 Apr 2005 15:16:01 -0000	1.423
--- info.el	7 Apr 2005 18:16:39 -0000
*************** The Lisp code is executed when the node 
*** 83,89 ****
    :group 'info)
  
  (defface info-xref
!   '((((class color) (background light)) :foreground "blue" :underline t)
      (((class color) (background dark)) :foreground "cyan" :underline t)
      (t :underline t))
    "Face for Info cross-references."
--- 83,93 ----
    :group 'info)
  
  (defface info-xref
!   '((((min-colors 88) 
!       (class color) (background light)) :foreground "blue1" :underline t)
!     (((class color) (background light)) :foreground "blue" :underline t)
!     (((min-colors 88) 
!       (class color) (background dark)) :foreground "cyan1" :underline t)
      (((class color) (background dark)) :foreground "cyan" :underline t)
      (t :underline t))
    "Face for Info cross-references."
Index: pcvs-info.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/pcvs-info.el,v
retrieving revision 1.20
diff -c -3 -p -r1.20 pcvs-info.el
*** pcvs-info.el	7 Sep 2004 04:51:47 -0000	1.20
--- pcvs-info.el	7 Apr 2005 18:16:39 -0000
*************** to confuse some users sometimes."
*** 105,111 ****
    :group 'pcl-cvs)
  
  (defface cvs-marked-face
!   '((((class color) (background dark))
       (:foreground "green" :weight bold))
      (((class color) (background light))
       (:foreground "green3" :weight bold))
--- 105,113 ----
    :group 'pcl-cvs)
  
  (defface cvs-marked-face
!   '((((min-colors 88) (class color) (background dark))
!      (:foreground "green1" :weight bold))
!     (((class color) (background dark))
       (:foreground "green" :weight bold))
      (((class color) (background light))
       (:foreground "green3" :weight bold))
Index: printing.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/printing.el,v
retrieving revision 1.26
diff -c -3 -p -r1.26 printing.el
*** printing.el	21 Nov 2004 23:05:20 -0000	1.26
--- printing.el	7 Apr 2005 18:16:39 -0000
*************** Please send all bug fixes and enhancemen
*** 994,1001 ****
  
  ;;; Code:
  
! 
! (require 'lpr)
  (require 'ps-print)
  
  
--- 994,1000 ----
  
  ;;; Code:
  
! ;;; this can be deleted if the test below is eliminated
  (require 'ps-print)
  
  
*************** COMMAND.exe, COMMAND.bat and COMMAND.com
*** 5754,5763 ****
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; Printing Interface (inspired on ps-print-interface.el)
  
! 
! (require 'widget)
! (require 'wid-edit)
! (require 'cus-edit)
  
  
  (defvar pr-i-window-configuration nil)
--- 5753,5762 ----
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; Printing Interface (inspired on ps-print-interface.el)
  
! ;; These are not needed, the functions used are autoloaded
! ;; (require 'widget)
! ;; (require 'wid-edit)
! ;; (require 'cus-edit)
  
  
  (defvar pr-i-window-configuration nil)
Index: smerge-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/smerge-mode.el,v
retrieving revision 1.33
diff -c -3 -p -r1.33 smerge-mode.el
*** smerge-mode.el	4 Apr 2005 09:09:01 -0000	1.33
--- smerge-mode.el	7 Apr 2005 18:16:39 -0000
*************** Used in `smerge-diff-base-mine' and rela
*** 76,83 ****
    :type 'boolean)
  
  (defface smerge-mine-face
!   '((((background light))
       (:foreground "blue"))
      (((background dark))
       (:foreground "cyan")))
    "Face for your code."
--- 76,87 ----
    :type 'boolean)
  
  (defface smerge-mine-face
!   '((((min-colors 88) (background light))
!      (:foreground "blue1"))
!     (((background light))
       (:foreground "blue"))
+     (((min-colors 88) (background dark))
+      (:foreground "cyan1"))
      (((background dark))
       (:foreground "cyan")))
    "Face for your code."
*************** Used in `smerge-diff-base-mine' and rela
*** 94,100 ****
  (defvar smerge-other-face 'smerge-other-face)
  
  (defface smerge-base-face
!   '((((background light))
       (:foreground "red"))
      (((background dark))
       (:foreground "orange")))
--- 98,106 ----
  (defvar smerge-other-face 'smerge-other-face)
  
  (defface smerge-base-face
!   '((((min-colors 88) (background light))
!      (:foreground "red1"))
!     (((background light))
       (:foreground "red"))
      (((background dark))
       (:foreground "orange")))
Index: whitespace.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/whitespace.el,v
retrieving revision 1.30
diff -c -3 -p -r1.30 whitespace.el
*** whitespace.el	16 Oct 2004 15:26:23 -0000	1.30
--- whitespace.el	7 Apr 2005 18:16:39 -0000
*************** To disable timer scans, set this to zero
*** 319,325 ****
    :group 'faces)
  
  (defface whitespace-highlight-face '((((class color) (background light))
! 				      (:background "green"))
  				     (((class color) (background dark))
  				      (:background "sea green"))
  				     (((class grayscale mono)
--- 319,325 ----
    :group 'faces)
  
  (defface whitespace-highlight-face '((((class color) (background light))
! 				      (:background "green1"))
  				     (((class color) (background dark))
  				      (:background "sea green"))
  				     (((class grayscale mono)
Index: wid-edit.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/wid-edit.el,v
retrieving revision 1.137
diff -c -3 -p -r1.137 wid-edit.el
*** wid-edit.el	5 Apr 2005 06:41:09 -0000	1.137
--- wid-edit.el	7 Apr 2005 18:16:39 -0000
*************** Recommended as a parent keymap for modes
*** 883,889 ****
         (lookup-key widget-global-map (this-command-keys))))))
  
  (defface widget-button-pressed-face
!   '((((class color))
       (:foreground "red"))
      (t
       (:weight bold :underline t)))
--- 883,891 ----
         (lookup-key widget-global-map (this-command-keys))))))
  
  (defface widget-button-pressed-face
!   '((((min-colors 88) (class color))
!      (:foreground "red1"))
!     (((class color))
       (:foreground "red"))
      (t
       (:weight bold :underline t)))
Index: woman.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/woman.el,v
retrieving revision 1.26
diff -c -3 -p -r1.26 woman.el
*** woman.el	15 Jan 2005 12:45:28 -0000	1.26
--- woman.el	7 Apr 2005 18:16:40 -0000
*************** or different fonts."
*** 876,888 ****
  ;; You should probably select either italic or underline as you prefer, but
  ;; not both, although italic and underline work together perfectly well!
  (defface woman-italic-face
!   `((((background light)) (:slant italic :underline t :foreground "red"))
      (((background dark)) (:slant italic :underline t)))
    "Face for italic font in man pages."
    :group 'woman-faces)
  
  (defface woman-bold-face
!   '((((background light)) (:weight bold :foreground "blue"))
      (((background dark)) (:weight bold :foreground "green2")))
    "Face for bold font in man pages."
    :group 'woman-faces)
--- 876,891 ----
  ;; You should probably select either italic or underline as you prefer, but
  ;; not both, although italic and underline work together perfectly well!
  (defface woman-italic-face
!   `((((min-colors 88) (background light)) 
!      (:slant italic :underline t :foreground "red1"))
!     (((background light)) (:slant italic :underline t :foreground "red"))
      (((background dark)) (:slant italic :underline t)))
    "Face for italic font in man pages."
    :group 'woman-faces)
  
  (defface woman-bold-face
!   '((((min-colors 88) (background light)) (:weight bold :foreground "blue1"))
!     (((background light)) (:weight bold :foreground "blue"))
      (((background dark)) (:weight bold :foreground "green2")))
    "Face for bold font in man pages."
    :group 'woman-faces)
*************** or different fonts."
*** 892,897 ****
--- 895,901 ----
  ;; non-standard fonts seem to do so badly or in idiosyncratic ways!)
  (defface woman-unknown-face
    '((((background light)) (:foreground "brown"))
+     (((min-colors 88) (background dark)) (:foreground "cyan1"))
      (((background dark)) (:foreground "cyan")))
    "Face for all unknown fonts in man pages."
    :group 'woman-faces)
Index: calendar/calendar.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calendar/calendar.el,v
retrieving revision 1.167
diff -c -3 -p -r1.167 calendar.el
*** calendar/calendar.el	30 Mar 2005 16:55:58 -0000	1.167
--- calendar/calendar.el	7 Apr 2005 18:16:40 -0000
*************** If nil, make an icon of the frame.  If n
*** 209,216 ****
  (defvar diary-face 'diary-face
    "Face name to use for diary entries.")
  (defface diary-face
!   '((((class color) (background light))
       :foreground "red")
      (((class color) (background dark))
       :foreground "yellow")
      (t
--- 209,220 ----
  (defvar diary-face 'diary-face
    "Face name to use for diary entries.")
  (defface diary-face
!   '((((min-colors 88) (class color) (background light))
!      :foreground "red1")
!     (((class color) (background light))
       :foreground "red")
+     (((min-colors 88) (class color) (background dark))
+      :foreground "yellow1")
      (((class color) (background dark))
       :foreground "yellow")
      (t
Index: emacs-lisp/re-builder.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/re-builder.el,v
retrieving revision 1.20
diff -c -3 -p -r1.20 re-builder.el
*** emacs-lisp/re-builder.el	27 Feb 2005 10:35:51 -0000	1.20
--- emacs-lisp/re-builder.el	7 Apr 2005 18:16:40 -0000
*************** Set it to nil if you don't want limits h
*** 177,183 ****
    :group 're-builder)
  
  (defface reb-match-3
!   '((((class color) (background light))
       :background "yellow")
      (((class color) (background dark))
       :background "sienna4")
--- 177,185 ----
    :group 're-builder)
  
  (defface reb-match-3
!   '((((min-colors 88) (class color) (background light))
!      :background "yellow1")
!     (((class color) (background light))
       :background "yellow")
      (((class color) (background dark))
       :background "sienna4")
Index: mh-e/mh-customize.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mh-e/mh-customize.el,v
retrieving revision 1.10
diff -c -3 -p -r1.10 mh-customize.el
*** mh-e/mh-customize.el	25 Aug 2004 05:57:29 -0000	1.10
--- mh-e/mh-customize.el	7 Apr 2005 18:16:41 -0000
*************** The background and foreground is used in
*** 2345,2353 ****
  
  (defface mh-speedbar-selected-folder-face
    '((((class color) (background light))
!      (:foreground "red" :underline t))
      (((class color) (background dark))
!      (:foreground "red" :underline t))
      (t (:underline t)))
    "Face used for the current folder."
    :group 'mh-speed-faces)
--- 2345,2353 ----
  
  (defface mh-speedbar-selected-folder-face
    '((((class color) (background light))
!      (:foreground "red1" :underline t))
      (((class color) (background dark))
!      (:foreground "red1" :underline t))
      (t (:underline t)))
    "Face used for the current folder."
    :group 'mh-speed-faces)
Index: progmodes/cc-fonts.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-fonts.el,v
retrieving revision 1.6
diff -c -3 -p -r1.6 cc-fonts.el
*** progmodes/cc-fonts.el	11 Aug 2004 16:22:21 -0000	1.6
--- progmodes/cc-fonts.el	7 Apr 2005 18:16:41 -0000
***************
*** 194,200 ****
  (unless (c-face-name-p c-invalid-face-name)
    (defconst c-invalid-face 'c-invalid-face) ; Necessary in Emacs 19.
    (defface c-invalid-face
!     '((((class color) (background light)) (:foreground "red"))
        (((class color)) (:foreground "hotpink"))
        (t (:inverse-video t)))
      "Face used to highlight invalid syntax."
--- 194,200 ----
  (unless (c-face-name-p c-invalid-face-name)
    (defconst c-invalid-face 'c-invalid-face) ; Necessary in Emacs 19.
    (defface c-invalid-face
!     '((((class color) (background light)) (:foreground "red1"))
        (((class color)) (:foreground "hotpink"))
        (t (:inverse-video t)))
      "Face used to highlight invalid syntax."
Index: progmodes/compile.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.349
diff -c -3 -p -r1.349 compile.el
*** progmodes/compile.el	7 Apr 2005 15:15:38 -0000	1.349
--- progmodes/compile.el	7 Apr 2005 18:16:41 -0000
*************** starting the compilation process.")
*** 464,469 ****
--- 464,471 ----
  (defface compilation-info-face
    '((((class color) (min-colors 16) (background light))
       (:foreground "Green3" :weight bold))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "Green1" :weight bold))
      (((class color) (min-colors 16) (background dark))
       (:foreground "Green" :weight bold))
      (((class color)) (:foreground "green" :weight bold))
Index: progmodes/ebrowse.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/ebrowse.el,v
retrieving revision 1.26
diff -c -3 -p -r1.26 ebrowse.el
*** progmodes/ebrowse.el	15 Jan 2005 12:38:08 -0000	1.26
--- progmodes/ebrowse.el	7 Apr 2005 18:16:41 -0000
*************** This space is used to display markers."
*** 158,170 ****
  
  
  (defface ebrowse-tree-mark-face
!   '((t (:foreground "red")))
    "*The face used for the mark character in the tree."
    :group 'ebrowse-faces)
  
  
  (defface ebrowse-root-class-face
!   '((t (:weight bold :foreground "blue")))
    "*The face used for root classes in the tree."
    :group 'ebrowse-faces)
  
--- 158,172 ----
  
  
  (defface ebrowse-tree-mark-face
!   '((((min-colors 88)) (:foreground "red1"))
!     (t (:foreground "red")))
    "*The face used for the mark character in the tree."
    :group 'ebrowse-faces)
  
  
  (defface ebrowse-root-class-face
!   '((((min-colors 88)) (:weight bold :foreground "blue1"))
!     (t (:weight bold :foreground "blue")))
    "*The face used for root classes in the tree."
    :group 'ebrowse-faces)
  
*************** This space is used to display markers."
*** 182,188 ****
  
  
  (defface ebrowse-member-attribute-face
!   '((t (:foreground "red")))
    "*Face used to display member attributes."
    :group 'ebrowse-faces)
  
--- 184,191 ----
  
  
  (defface ebrowse-member-attribute-face
!   '((((min-colors 88)) (:foreground "red1"))
!     (t (:foreground "red")))
    "*Face used to display member attributes."
    :group 'ebrowse-faces)
  
*************** This space is used to display markers."
*** 194,200 ****
  
  
  (defface ebrowse-progress-face
!   '((t (:background "blue")))
    "*Face for progress indicator."
    :group 'ebrowse-faces)
  
--- 197,204 ----
  
  
  (defface ebrowse-progress-face
!   '((((min-colors 88)) (:background "blue1"))
!     (t (:background "blue")))
    "*Face for progress indicator."
    :group 'ebrowse-faces)
  
Index: progmodes/idlw-help.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/idlw-help.el,v
retrieving revision 1.2
diff -c -3 -p -r1.2 idlw-help.el
*** progmodes/idlw-help.el	17 Nov 2004 11:45:29 -0000	1.2
--- progmodes/idlw-help.el	7 Apr 2005 18:16:41 -0000
*************** support."
*** 183,189 ****
    :type 'string)
  
  (defface idlwave-help-link-face
!   '((((class color)) (:foreground "Blue"))
      (t (:weight bold)))
    "Face for highlighting links into IDLWAVE online help."
    :group 'idlwave-online-help)
--- 183,190 ----
    :type 'string)
  
  (defface idlwave-help-link-face
!   '((((min-colors 88) (class color)) (:foreground "Blue1"))
!     (((class color)) (:foreground "Blue"))
      (t (:weight bold)))
    "Face for highlighting links into IDLWAVE online help."
    :group 'idlwave-online-help)
Index: progmodes/sh-script.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/sh-script.el,v
retrieving revision 1.147
diff -c -3 -p -r1.147 sh-script.el
*** progmodes/sh-script.el	5 Apr 2005 13:07:42 -0000	1.147
--- progmodes/sh-script.el	7 Apr 2005 18:16:42 -0000
*************** See `sh-feature'.")
*** 779,785 ****
  ;; Font-Lock support
  
  (defface sh-heredoc-face
!   '((((class color)
        (background dark))
       (:foreground "yellow" :weight bold))
      (((class color)
--- 779,788 ----
  ;; Font-Lock support
  
  (defface sh-heredoc-face
!   '((((min-colors 88) (class color)
!       (background dark))
!      (:foreground "yellow1" :weight bold))
!     (((class color)
        (background dark))
       (:foreground "yellow" :weight bold))
      (((class color)
Index: progmodes/vhdl-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/vhdl-mode.el,v
retrieving revision 1.25
diff -c -3 -p -r1.25 vhdl-mode.el
*** progmodes/vhdl-mode.el	25 Mar 2005 10:06:23 -0000	1.25
--- progmodes/vhdl-mode.el	7 Apr 2005 18:16:42 -0000
*************** This does background highlighting of tra
*** 12593,12599 ****
   'vhdl-highlight-faces 'font-lock-variable-name-face 'custom-face)
  
  (defface vhdl-font-lock-prompt-face
!   '((((class color) (background light)) (:foreground "Red" :bold t))
      (((class color) (background dark)) (:foreground "Pink" :bold t))
      (t (:inverse-video t)))
    "Font lock mode face used to highlight prompts."
--- 12593,12601 ----
   'vhdl-highlight-faces 'font-lock-variable-name-face 'custom-face)
  
  (defface vhdl-font-lock-prompt-face
!   '((((min-colors 88) (class color) (background light)) 
!      (:foreground "Red1" :bold t))
!     (((class color) (background light)) (:foreground "Red" :bold t))
      (((class color) (background dark)) (:foreground "Pink" :bold t))
      (t (:inverse-video t)))
    "Font lock mode face used to highlight prompts."
*************** This does background highlighting of tra
*** 12634,12639 ****
--- 12636,12643 ----
  
  (defface vhdl-font-lock-reserved-words-face
    '((((class color) (background light)) (:foreground "Orange" :bold t))
+     (((min-colors 88) (class color) (background dark)) 
+      (:foreground "Yellow1" :bold t))
      (((class color) (background dark)) (:foreground "Yellow" :bold t))
      (t ()))
    "Font lock mode face used to highlight additional reserved words."
*************** expansion function)."
*** 14975,14981 ****
    :group 'speedbar-faces)
  
  (defface vhdl-speedbar-architecture-face
!   '((((class color) (background light)) (:foreground "Blue"))
      (((class color) (background dark)) (:foreground "LightSkyBlue")))
    "Face used for displaying architecture names."
    :group 'speedbar-faces)
--- 14979,14986 ----
    :group 'speedbar-faces)
  
  (defface vhdl-speedbar-architecture-face
!   '((((min-colors 88) (class color) (background light)) (:foreground "Blue1"))
!     (((class color) (background light)) (:foreground "Blue"))
      (((class color) (background dark)) (:foreground "LightSkyBlue")))
    "Face used for displaying architecture names."
    :group 'speedbar-faces)
*************** expansion function)."
*** 15000,15005 ****
--- 15005,15011 ----
  
  (defface vhdl-speedbar-instantiation-face
    '((((class color) (background light)) (:foreground "Brown"))
+     (((min-colors 88) (class color) (background dark)) (:foreground "Yellow1"))
      (((class color) (background dark)) (:foreground "Yellow")))
    "Face used for displaying instantiation names."
    :group 'speedbar-faces)
*************** expansion function)."
*** 15017,15023 ****
    :group 'speedbar-faces)
  
  (defface vhdl-speedbar-architecture-selected-face
!   '((((class color) (background light)) (:foreground "Blue" :underline t))
      (((class color) (background dark)) (:foreground "LightSkyBlue" :underline t)))
    "Face used for displaying architecture names."
    :group 'speedbar-faces)
--- 15023,15031 ----
    :group 'speedbar-faces)
  
  (defface vhdl-speedbar-architecture-selected-face
!   '((((min-colors 88) (class color) (background light)) (:foreground "Blue1" :underline t))
!     (((min-colors 88) (class color) (background light)) (:foreground "Blue1" :underline t))
!     (((class color) (background light)) (:foreground "Blue" :underline t))
      (((class color) (background dark)) (:foreground "LightSkyBlue" :underline t)))
    "Face used for displaying architecture names."
    :group 'speedbar-faces)
*************** expansion function)."
*** 15036,15041 ****
--- 15044,15050 ----
  
  (defface vhdl-speedbar-instantiation-selected-face
    '((((class color) (background light)) (:foreground "Brown" :underline t))
+     (((min-colors 88) (class color) (background dark)) (:foreground "Yellow1" :underline t))
      (((class color) (background dark)) (:foreground "Yellow" :underline t)))
    "Face used for displaying instantiation names."
    :group 'speedbar-faces)
Index: textmodes/table.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/textmodes/table.el,v
retrieving revision 1.12
diff -c -3 -p -r1.12 table.el
*** textmodes/table.el	18 Mar 2005 23:17:05 -0000	1.12
--- textmodes/table.el	7 Apr 2005 18:16:43 -0000
*************** height."
*** 683,689 ****
    :group 'table)
  
  (defface table-cell-face
!   '((((class color))
       (:foreground "gray90" :background "blue"))
      (t (:bold t)))
    "*Face used for table cell contents."
--- 683,691 ----
    :group 'table)
  
  (defface table-cell-face
!   '((((min-colors 88) (class color))
!      (:foreground "gray90" :background "blue1"))
!     (((class color))
       (:foreground "gray90" :background "blue"))
      (t (:bold t)))
    "*Face used for table cell contents."

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-06 17:36   ` David Kastrup
  2005-04-06 17:46     ` Eli Zaretskii
  2005-04-06 18:26     ` Dan Nicolaescu
@ 2005-04-07 20:43     ` James Cloos
  2005-04-08  1:17       ` Dan Nicolaescu
  2 siblings, 1 reply; 22+ messages in thread
From: James Cloos @ 2005-04-07 20:43 UTC (permalink / raw)


>>>>> "David" == David Kastrup <dak@gnu.org> writes:

David> Actually, it does not make sense to scale in that way.  #3a7
David> really should be the same as #3333aaaa7777, so that #fff is the
David> same as #ffffffffffff, pure white.

David> Somebody should tell the X people to do that.

I beleive I recall this coming up on the xfree lists some years back,
and further beleive that the current codebase of both xfree and xorg
do in fact scale the way David recomends.

It is likely that only the docs are out of date.

It is certainly the case that the colours named by xmag(1x) when you
click on a pixel in its window show the replicated pattern, and I tend
to use the #rrggbb convention for specifying colours....

-JimC
-- 
James H. Cloos, Jr. <cloos@jhcloos.com>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-07 10:23             ` David Kastrup
@ 2005-04-08  1:13               ` Dan Nicolaescu
  0 siblings, 0 replies; 22+ messages in thread
From: Dan Nicolaescu @ 2005-04-08  1:13 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

David Kastrup <dak@gnu.org> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > 
  > > David Kastrup <dak@gnu.org> writes:
  > >
  > >   > I am certain I am missing the context, but is this really
  > >   > related to the #RRGGBB notation in any manner?  It really looks
  > >   > awful to me if white gets defined as #ff00ff00ff00, so I'd like
  > >   > to be as bothersome as to be grateful for some factual
  > >   > reassurance that we are indeed catering here for a real instead
  > >   > of a perceived problem, and that the fix in that manner is the
  > >   > right thing to do.
  > >
  > > Well,  there patch has 3 parts. 
  > >
  > > Part1:
  > > The patch to xterm-register-default-colors changes the way the 8bit
  > > R/G/B values are computed for a 256 color xterm to match what the
  > > xterm currently does. This part should be correct and
  > > non-controversial.
  > 
  > Ok.
  > 
  > > Part2:
  > > xterm-rgb-convert-to-16bit converts an 8bit color value (say Y) to a 16bit
  > > color. As we discussed, the result can either be Y0 or YY.
  > > My empirical testing show that there's no visible difference between
  > > the two. 
  > 
  > If by "visible" you mean "undiscernible by the unadorned eye as long
  > as no gamma correction is applied", sure.  If by "visible" you mean
  > "undiscernible by the computer so that the heuristic-mask image
  > property has a chance of working with an explicit color", we are
  > talking something entirely different here.
  >
  > man Xcolor:

[snip]

Actually the color values in xterm.el and tty-colors.el are not used
this way at all. The xterm can only display a fixed set of 256
colors. The 16bit values are just used for finding which of the 256
colors the xterm can display should be used for a color name that
appears in rgb.txt (or a color given as R G B components).
My empirical testing was to display all the colors in rgb.txt in an
emacs buffer and see if they are displayed the same when using the Y0
or YY mapping. They seemed to be. Of course this is not a formal
proof... 

         --dan

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-07 20:43     ` James Cloos
@ 2005-04-08  1:17       ` Dan Nicolaescu
  2005-04-08 10:52         ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Dan Nicolaescu @ 2005-04-08  1:17 UTC (permalink / raw)
  Cc: eliz

James Cloos <cloos@jhcloos.com> writes:

  > >>>>> "David" == David Kastrup <dak@gnu.org> writes:
  > 
  > David> Actually, it does not make sense to scale in that way.  #3a7
  > David> really should be the same as #3333aaaa7777, so that #fff is the
  > David> same as #ffffffffffff, pure white.
  > 
  > David> Somebody should tell the X people to do that.
  > 
  > I beleive I recall this coming up on the xfree lists some years back,
  > and further beleive that the current codebase of both xfree and xorg
  > do in fact scale the way David recomends.
  > 
  > It is likely that only the docs are out of date.
  > 
  > It is certainly the case that the colours named by xmag(1x) when you
  > click on a pixel in its window show the replicated pattern, and I tend
  > to use the #rrggbb convention for specifying colours....

Great! Thanks, I think this is the info we needed.
I tried xmag on both solaris2.8 and Fedora Core 3 and indeed it seems
that the conversion it uses is Y -> YY (where Y is 8bit).
Eli, do you agree to go this way? 

        --dan

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-08  1:17       ` Dan Nicolaescu
@ 2005-04-08 10:52         ` Eli Zaretskii
  2005-04-08 15:13           ` Dan Nicolaescu
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2005-04-08 10:52 UTC (permalink / raw)
  Cc: emacs-devel

> Cc: eliz@gnu.org
> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Thu, 07 Apr 2005 18:17:48 -0700
> 
> James Cloos <cloos@jhcloos.com> writes:
> 
>   > I beleive I recall this coming up on the xfree lists some years back,
>   > and further beleive that the current codebase of both xfree and xorg
>   > do in fact scale the way David recomends.
>   > 
>   > It is likely that only the docs are out of date.
>   > 
>   > It is certainly the case that the colours named by xmag(1x) when you
>   > click on a pixel in its window show the replicated pattern, and I tend
>   > to use the #rrggbb convention for specifying colours....
> 
> Great! Thanks, I think this is the info we needed.
> I tried xmag on both solaris2.8 and Fedora Core 3 and indeed it seems
> that the conversion it uses is Y -> YY (where Y is 8bit).
> Eli, do you agree to go this way? 

I'd prefer not to make such a significant change in
tty-color-standard-values before the release.  The current scheme
worked well for several 21.x releases, and I don't think we should
make radical changes in it now, before we've seen the 256-color xterm
support in a released Emacs.  Let's wait until after the release.

But I think the info above means that we should leave
color-name-rgb-alist alone, since it already uses the scheme James
says is now standard in X, and changing it now just to change it back
for the next release sounds silly.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-07 18:27       ` Dan Nicolaescu
@ 2005-04-08 10:54         ` Eli Zaretskii
  0 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2005-04-08 10:54 UTC (permalink / raw)
  Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Thu, 07 Apr 2005 11:27:36 -0700
> 
>   > So I think we should change this patch so as not to change the color
>   > definitions on displays that support less than 88 colors.  That is, in
>   > those cases where there's a single color definition, split it into 2
>   > and change only the one for >88 colors.
> 
> OK, I did this, except for a few faces that are supposed to stand out
> by design, for those using the brighter colors seemed more appropriate
> for 16-colore terminals too. These faces are:  custom-invalid-face
> trailing-whitespace, c-invalid-face-name, whitespace-highlight-face.

Fair enough.  I took a look at the patches, and they seem okay to me.
Thanks.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-08 10:52         ` Eli Zaretskii
@ 2005-04-08 15:13           ` Dan Nicolaescu
  2005-04-09  8:06             ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Dan Nicolaescu @ 2005-04-08 15:13 UTC (permalink / raw)
  Cc: emacs-devel

"Eli Zaretskii" <eliz@gnu.org> writes:

  > > Cc: eliz@gnu.org
  > > From: Dan Nicolaescu <dann@ics.uci.edu>
  > > Date: Thu, 07 Apr 2005 18:17:48 -0700
  > > 
  > > James Cloos <cloos@jhcloos.com> writes:
  > > 
  > >   > I beleive I recall this coming up on the xfree lists some years back,
  > >   > and further beleive that the current codebase of both xfree and xorg
  > >   > do in fact scale the way David recomends.
  > >   > 
  > >   > It is likely that only the docs are out of date.
  > >   > 
  > >   > It is certainly the case that the colours named by xmag(1x) when you
  > >   > click on a pixel in its window show the replicated pattern, and I tend
  > >   > to use the #rrggbb convention for specifying colours....
  > > 
  > > Great! Thanks, I think this is the info we needed.
  > > I tried xmag on both solaris2.8 and Fedora Core 3 and indeed it seems
  > > that the conversion it uses is Y -> YY (where Y is 8bit).
  > > Eli, do you agree to go this way? 
  > 
  > I'd prefer not to make such a significant change in
  > tty-color-standard-values before the release.  The current scheme
  > worked well for several 21.x releases, and I don't think we should
  > make radical changes in it now, before we've seen the 256-color xterm
  > support in a released Emacs.  Let's wait until after the release.
  > 
  > But I think the info above means that we should leave
  > color-name-rgb-alist alone, since it already uses the scheme James
  > says is now standard in X, and changing it now just to change it back
  > for the next release sounds silly.

OK. 

What about the xterm.el patch for xterm-register-default-colors and
xterm-rgb-convert-to-16bit?
I have verified that after this patch the color values produced by
xterm-register-default-colors are exactly the same
as the color values produced by xterm-200/256colres.pl and
xterm-200/88colres.pl (well, the corresponding 8bit version). 
[This patch actually improves the color display and fixes the
non-linearity problem in the gray scale].
 

Index: lisp/term/xterm.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/xterm.el,v
retrieving revision 1.11
diff -c -3 -p -r1.11 xterm.el
*** lisp/term/xterm.el	6 Apr 2005 21:38:34 -0000	1.11
--- lisp/term/xterm.el	8 Apr 2005 15:08:14 -0000
***************
*** 123,129 ****
  
  (defun xterm-rgb-convert-to-16bit (prim)
    "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
!   (min 65535 (round (* (/ prim 255.0) 65535.0))))
  
  (defun xterm-register-default-colors ()
    "Register the default set of colors for xterm or compatible emulator.
--- 123,129 ----
  
  (defun xterm-rgb-convert-to-16bit (prim)
    "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
!   (logior prim (lsh prim 8)))
  
  (defun xterm-register-default-colors ()
    "Register the default set of colors for xterm or compatible emulator.
*************** versions of xterm."
*** 160,168 ****
  	    (tty-color-define (format "color-%d" (- 256 ncolors))
  			      (- 256 ncolors)
  			      (mapcar 'xterm-rgb-convert-to-16bit
! 				      (list (round (* r 42.5))
! 					    (round (* g 42.5))
! 					    (round (* b 42.5)))))
  	    (setq b (1+ b))
  	    (if (> b 5)
  		(setq g (1+ g)
--- 160,169 ----
  	    (tty-color-define (format "color-%d" (- 256 ncolors))
  			      (- 256 ncolors)
  			      (mapcar 'xterm-rgb-convert-to-16bit
! 				      (list (if (zerop r) 0 (+ (* r 40) 55))
! 					    (if (zerop g) 0 (+ (* g 40) 55))
! 					    (if (zerop b) 0 (+ (* b 40) 55)))))
! 
  	    (setq b (1+ b))
  	    (if (> b 5)
  		(setq g (1+ g)
*************** versions of xterm."
*** 200,206 ****
  	;; Now the 8 gray colors
  	(while (> ncolors 0)
  	  (setq color (xterm-rgb-convert-to-16bit
! 		       (round
  			(if (= ncolors 8)
  			    46.36363636
  			  (+ (* (- 8 ncolors) 23.18181818) 69.54545454)))))
--- 201,207 ----
  	;; Now the 8 gray colors
  	(while (> ncolors 0)
  	  (setq color (xterm-rgb-convert-to-16bit
! 		       (floor
  			(if (= ncolors 8)
  			    46.36363636
  			  (+ (* (- 8 ncolors) 23.18181818) 69.54545454)))))

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: face colors on 256 colors terminals
  2005-04-08 15:13           ` Dan Nicolaescu
@ 2005-04-09  8:06             ` Eli Zaretskii
  0 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2005-04-09  8:06 UTC (permalink / raw)
  Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Fri, 08 Apr 2005 08:13:08 -0700
> 
> What about the xterm.el patch for xterm-register-default-colors and
> xterm-rgb-convert-to-16bit?

I think everybody agreed that these changes are okay.  So please
commit them.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2005-04-09  8:06 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-06  8:17 face colors on 256 colors terminals Dan Nicolaescu
2005-04-06 17:23 ` Eli Zaretskii
2005-04-06 17:36   ` David Kastrup
2005-04-06 17:46     ` Eli Zaretskii
2005-04-06 18:03       ` David Kastrup
2005-04-06 18:26     ` Dan Nicolaescu
2005-04-07 20:43     ` James Cloos
2005-04-08  1:17       ` Dan Nicolaescu
2005-04-08 10:52         ` Eli Zaretskii
2005-04-08 15:13           ` Dan Nicolaescu
2005-04-09  8:06             ` Eli Zaretskii
2005-04-06 17:52   ` Dan Nicolaescu
     [not found]     ` <01c53aea$Blat.v2.4$16ee4740@zahav.net.il>
2005-04-06 23:50       ` Dan Nicolaescu
2005-04-07  0:22         ` David Kastrup
2005-04-07  3:58           ` Eli Zaretskii
2005-04-07  5:14           ` Dan Nicolaescu
2005-04-07 10:23             ` David Kastrup
2005-04-08  1:13               ` Dan Nicolaescu
2005-04-07  3:55         ` Eli Zaretskii
     [not found]   ` <200504062134.j36LY8AH022227@scanner2.ics.uci.edu>
2005-04-07  3:53     ` Eli Zaretskii
2005-04-07 18:27       ` Dan Nicolaescu
2005-04-08 10:54         ` Eli Zaretskii

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).