Subject: How to specify numeric color values in _emacs?

From: "James P.G. Sterbenz" <[email-masked]>
Date: Fri, 15 Nov 96 11:43:05 -0500

I've just started using a laptop with win95, and am trying to get my
emacs to look as much like my Unix environment as I can.  I can do
things like

(set-foreground-color "cyan")
just fine, but I really want to use rgb values; here is my Unix
.Xdefaults for emacs:

emacs*foreground:                       #90e0ff
emacs*background:                       #003040
emacs*pointerColor:                     #ffffff
emacs*cursorColor:                      #ffffff
emacs.region.attributeForeground:	#ffffff
emacs.region.attributeBackground:	#002838
emacs.modeline.attributeForeground:	#ffffff
emacs.modeline.attributeBackground:	#0080ff
emacs.bold.attributeForeground:		#00ffff
emacs.highlight.attributeForeground:	#ff0000
emacs.secondary-selection:		#ffff00
emacs*menu.popup.font:			Rom11.500
emacs*menu.popup.foreground: 		#00ffff
emacs*menu.popup.background: 		#004060
emacs*menubar.foreground:	 	#00ffff
emacs*menubar.background:	 	#006080
emacs*menubar.buttonForeground: 	#ffffff
emacs*menubar.buttonBackground: 	#0080ff

I've tried various substitutions of the color name using both the
RGB style here (that I've used forever in X) and what I think is
a correct form of the rgb:rrrr/gggg/bbbb with no luck.  I'm sure I'm
just doing something wrong in elisp (at which I'm not very
proficient).  Can anyone give me a working version of

(set-foreground-color "#90e0ff")
or
(set-foreground-color "rgb:90/e0/ff")
or whatever it should be?  Do I have to worry about the number of bits
depending on the display type?

Can I control *other* colors like the region and modeline like I do in
X?  Can I change the colors of the Windows menus? (I expect the answer
is no, but it is worth a try...)

Of course, I looked at the readme, the ntemacs web page, and did a DejaNews
search, but didn't find anything concrete enough to tell me what I'm
doing wrong.

Thanks much in advance,
James

James P.G. Sterbenz            | chair IEEE ComSoc TCGN |     Sr. MTS, GTE Labs
jpgs@{acm|ieee}.org            | PGP  Key ID = CBBA3CD9 |  40 Sylvan Road MS-47
+1 617 466 2786                | print=159533245CE354E1 | Waltham, MA 02254 USA
http://www.ccrc.wustl.edu/~jpgs|       9C54297E47D71A8C |   [opinions are mine]

---

From: Andrew Innes <[email-masked]>
Date: Fri, 15 Nov 1996 17:28:38 GMT

On Fri, 15 Nov 96 11:43:05 -0500, "James P.G. Sterbenz" <[email-masked]> said:
[ .. ]
>proficient).

You aren't doing anything wrong, it is just that NT Emacs doesn't
recognise #xxxxxx as a literal RGB colour specifier (we can easily add
that for 19.35).  I think under X, it is Xlib that handles that, not
Emacs.

>Can anyone give me a working version of
>

You don't need to worry about display type.

As a hack to get this to work, you just need to register "#90e0ff" as a
named colour by adding the cons pair `("#90e0ff" . N)' where N is the
rgb value as a number (9494783 in this case) to `win32-color-map'.

Someone could probably show you how to use defadvise to make this
transparent.

>is no, but it is worth a try...)

Region and modeline can be customized, but the menu-bar is a standard
Windows one, and is controled by the desktop colour scheme defined in
Control Panel.

AndrewI

---

From: "James P.G. Sterbenz" <[email-masked]>
Date: Fri, 15 Nov 96 14:18:44 -0500

>rgb value as a number (9494783 in this case) to `win32-color-map'.

OK, works like a charm; thanks!

>Someone could probably show you how to use defadvise to make this

I'm not sure what defadvise *is*, but I don't mind 2 lines per color.

>Region and modeline can be customized,

How can I do this?  There isn't a set-<mumble>-color command for things like
modeline-background, modeline-foreground, 
region-foreground, region-background,
attribute-foreground, attribute-background
Not only isn't it in the manual, but I tried a few obvious
combinations in case they were secret commands.

Can I customise from .emacs using elisp, or does it require a source
code change and rebuild?

>but the menu-bar is a standard

I expected this.  Now, if I just could get Windows to use the focus
and raise policy I want, I'd feel better about all this...

Finally, how do I get colors working for various modes?  I currently
use hilit19 under X-windows, and have a customised set of colors for
html mode.  Do (or should) I start using faces?  Or can (should) I just
do

(cond (window-system
       (setq hilit-mode-enable-list  '(not text-mode)
             hilit-background-mode   'light
             hilit-inhibit-hooks     nil
             hilit-inhibit-rebinding nil)

       (require 'hilit19)
       ))

as I do now?  I seem to remember that hilit19 was on the way out.

Thanks much,
James