I have a customization requirement (for branding purposes) to define custom colors for several backgrounds. This needs to use new color names rather than hard-wired #hex so that it can go in a shared .emacs. I don't seem to be able to find the command that will (for example) set foobar to be #314159
The requirement was for a different background color for each remote host logged into. This snippet is now at the end of the shared .emacs on each host:
(setq colors-for-machines
'(
("adam" . "seashell")
("eve" . "lavender blush")
("lucifer" . "lavender")
("cherub" . "linen")
("moly" . "alice blue")
("athame" . "mint cream")
("aziraphael" . "alice blue")
))
;;
(set-background-color
(cdr
(assoc (nth 0 (split-string (system-name) "\\."))
colors-for-machines)))
(edited for names to protect the guilty :-)
Thanks to all who contributed.
-
Just curious -- any reason you went with
(nth 0 ...)
instead of(car ...)
? – cyberbisson Apr 26 '19 at 15:06
(setq foobar "#314160")
– Drew May 28 '18 at 13:54defface
? Virtually every library I can think of define a few faces ... – lawlist May 28 '18 at 17:32