Anyway, to change the colors that emacs uses, you can do something like (yuk!)
(set-face-foreground 'default "blue")
(set-face-background 'default "green")

You can also use set-face-foreground et al interactively; it lets you scroll to a long list of named colors, and alternatively you can use an HTML-style "#RRGGBB" hexadecimal red-green-blue color description. For example, "#000000" is black, "#ffffff" is white, and all colors of the form "#XYXYXY" (the RGB components are equal) give you various shades of gray: "#151515" is a rather dark gray, while "#e5e5e5" is rather light. For the full rainbow, a program like The Gimp can give you the hex-representation.
Using this knowledge, we can define all the colors, make comments gray, warnings red and so on. However, some people have already done much of the work for you, and prepared a wide range of color themes -- get the color-theme-el package. After installing, you can select interesting color-themes like M-x color-theme-subtle-hacker or M-x color-theme-blippblopp. Meanwhile, color-theme-select gives you an overview of all available color theme.
Of course, we're not happy with any of those, and prefer our very own theme. See below for an example of how to create your own color theme. When you're totally happy with the theme, you could even submit it to the color-theme people, and it might end up in a future version of the package.
(require 'color-theme)
(defun color-theme-djcb-dark ()
"dark color theme created by djcb, Jan. 2009."
(interactive)
(color-theme-install
'(color-theme-djcb-dark
((foreground-color . "#a9eadf")
(background-color . "black")
(background-mode . dark))
(bold ((t (:bold t))))
(bold-italic ((t (:italic t :bold t))))
(default ((t (nil))))
(font-lock-builtin-face ((t (:italic t :foreground "#a96da0"))))
(font-lock-comment-face ((t (:italic t :foreground "#bbbbbb"))))
(font-lock-comment-delimiter-face ((t (:foreground "#666666"))))
(font-lock-constant-face ((t (:bold t :foreground "#197b6e"))))
(font-lock-doc-string-face ((t (:foreground "#3041c4"))))
(font-lock-doc-face ((t (:foreground "gray"))))
(font-lock-reference-face ((t (:foreground "white"))))
(font-lock-function-name-face ((t (:foreground "#356da0"))))
(font-lock-keyword-face ((t (:bold t :foreground "#bcf0f1"))))
(font-lock-preprocessor-face ((t (:foreground "#e3ea94"))))
(font-lock-string-face ((t (:foreground "#ffffff"))))
(font-lock-type-face ((t (:bold t :foreground "#364498"))))
(font-lock-variable-name-face ((t (:foreground "#7685de"))))
(font-lock-warning-face ((t (:bold t :italic nil :underline nil
:foreground "yellow"))))
(hl-line ((t (:background "#112233"))))
(mode-line ((t (:foreground "#ffffff" :background "#333333"))))
(region ((t (:foreground nil :background "#555555"))))
(show-paren-match-face ((t (:bold t :foreground "#ffffff"
:background "#050505")))))))
To activate this theme, simply do M-x color-theme-djcb-dark. One nice side-effect of the color-theme package is the fact that colors work properly when you open new frames (windows).
No comments:
Post a Comment