What’s a Good Color Scheme?

Although EMACS is growing old, filled with passé idiosyncrasies, and rather complicated to tweak, I grew accustomed to it and is now my main editor. I use it for shell scripting, C++, HTML, even. But to use EMACS properly, or a least make it enjoyable a little bit, one must do a fair bit of configuration. Key bindings to match modern keyboards, adding the macros you’re using the most, and, finally, adjusting the color scheme so that your eyes do not bleed after a few hours of work.

yeux-saignants

But what is a good color scheme?

First of all, many editors start off with, in my opinion, very bad color schemes. White background, black foreground for normal text, then more or less flashy colors for syntax highlighting. Flashy colors on white background are, paradoxically, rather hard to read, especially if you’re not using a very large font. For example, consider this scheme:

A Proposed Color Scheme for JAVA

A Proposed Color Scheme for JAVA

I took this from Chabster’s blog. The bright purplish rose is atrocious and most of the colors are not as contrasted as they should be—again, in my own opinion.

White background are, depending on your screen, very luminous and contribute a lot to visual fatigue. Colors that are different but hard to distinguish unless you’re up close, like pale teal and grayish green, are also bad choices for color-coded information—again, no comparative study, just my impressions. However, many do share this view, as you can see from the Joel on Software forum. To alleviate this problem, I use a darker background and avoid using too many colors.

My color scheme originated in the era of CGA color; where you had a quite limited palette of 16 colors. I, of course, adjusted the colors since then, gradually, as technology permitted (do you remember that you needed a plug-in in Visual Studio to have more than those 16 base colors?). I now have a Dark blue background (#000030), moderate grays and white for syntax highlighting, and not that much color for the other elements. Here’s a screen-shot:

My Color Scheme

My Color Scheme

I find it rather easy on the eyes, even though I use a small font, the X 6×10 font. But what do you think? What’s your favorite color scheme?

*
* *

If you want to configure emacs with your own color scheme, you can refer to the Color Theme page from the EMACS wiki. Apparently, I’m not the only one working hard to tweak colors. On Flickr! there’s a emacs screen-shot group that may give you ideas for your own color scheme or layout.

VIM users can find preconfigured color schemes as well. There’s a VIM color scheme test page. The guy also maintain the same for EMACS here.

7 Responses to What’s a Good Color Scheme?

  1. Lrrr says:

    Microsoft and Borland lawyers from 1991 called. They want their color scheme back.

    • Steven Pigeon says:

      Ha ha ha good one! But you’re still pretty much on target: as I said, I got the first variant of this color scheme using the very limited palette of VGA. Like, when 80×50 text mode was hot.

  2. […] What's a Good Color Scheme? « Harder, Better, Faster, Stronger […]

  3. […] that coding styles have claimed fewer victims—at least until now. A few post back I discussed color schemes, and this week I’ll be discussing code geometry for enhanced […]

  4. azaroma says:

    You should share it!

    • Here you go:

      (custom-set-faces
      ;; custom-set-faces was added by Custom.
      ;; If you edit it by hand, you could mess it up, so be careful.
      ;; Your init file should contain only one such instance.
      ;; If there is more than one, they won’t work right.

      ‘(border ((t (:background "black" :width extra-expanded))))
      ‘(font-lock-builtin-face ((((class color) (background dark)) (:foreground "white"))))
      ‘(font-lock-comment-face ((((class color) (background dark)) (:foreground "green"))))
      ‘(font-lock-doc-face ((((class color) (background dark)) (:foreground "deep sky blue"))))
      ‘(font-lock-doc-string-face ((((class color) (background dark)) (:foreground "deep sky blue"))))
      ‘(font-lock-constant-face ((((class color) (background dark)) (:foreground "orange"))))
      ‘(font-lock-special-macro-face ((((class color) (background dark)) (:foreground "magenta"))))
      ‘(font-lock-function-name-face ((((class color) (background dark)) (:foreground "yellow"))))
      ‘(font-lock-preprocessor-face ((t (:italic nil :foreground "grey50"))))
      ‘(font-lock-keyword-face ((((class color) (background dark)) (:foreground "white"))))
      ‘(font-lock-number-face ((((class color) (background dark)) (:foreground "yellow"))))
      ‘(font-lock-reference-face ((((class color) (background dark)) (:foreground "orange"))))
      ‘(font-lock-string-face ((((class color) (background dark)) (:foreground "cyan"))))
      ‘(font-lock-type-face ((((class color) (background dark)) (:foreground "white"))))
      ‘(font-lock-variable-name-face ((((class color) (background dark)) (:foreground "gray75"))))
      ‘(font-lock-warning-face ((((class color) (background dark)) (:foreground "red"))))
      ‘(show-paren-match ((t (:foreground "orange"))))
      ‘(show-paren-mismatch ((((class color)) (:foreground "red"))))
      ‘(fringe ((((class color) (background dark)) (:background "RGB:0/0/30"))))
      ‘(menu ((nil (:background "gray85" :foreground "black" :height 75 :family "DejaVu Sans"))))

      ‘(html-helper-bold-face ((t (:foreground "white" :weight bold))))
      ‘(html-helper-italic-face ((t (:slant italic))))
      ‘(html-helper-underline-face (( t (:underline t))))
      ‘(html-tag-face ((t (:foreground "Dodger Blue"))))

      ‘(region ((t (:background "RGB:0/0/60"))))

      ‘(whitespace-space ((((class color) (background dark)) (:foreground "orange"))))
      ‘(whitespace-hspace ((((class color) (background dark)) (:foreground "orange"))))
      ‘(whitespace-empty ((((class color) (background dark)) (:background "RGB:20/20/50"))))
      ‘(whitespace-tab ((((class color) (background dark)) (:foreground "orange"))))
      ‘(whitespace-newline ((((class color) (background dark)) (:foreground "red"))))
      ‘(whitespace-trailing ((((class color) (background dark)) (:foreground "red" :background "red"))))
      ‘(whitespace-line ((((class color) (background dark)) ())))
      ‘(whitespace-space-befor-tab ((((class color) (background dark)) (:foreground "orange"))))
      ‘(whitespace-space-after-tab ((t (:foreground "firebrick"))))

      )

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: