* etc/themes/dichromacy-theme.el: New theme.
[bpt/emacs.git] / etc / themes / dichromacy-theme.el
1 ;;; dichromacy-theme.el --- color theme suitable for color-blind users
2
3 ;; Copyright (C) 2011 Free Software Foundation, Inc.
4
5 ;; Author: Chong Yidong <cyd@stupidchicken>
6
7 ;; This file is part of GNU Emacs.
8
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
13
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22 ;;; Code:
23
24 (deftheme dichromacy
25 "Face colors suitable for red/green color-blind users.
26 The color palette is from B. Wong, Nature Methods 8, 441 (2011).
27 It is intended to provide good variability while being easily
28 differentiated by individuals with protanopia or deuteranopia.
29
30 Basic, Font Lock, Isearch, Gnus, Message, Flyspell, and
31 Ansi-Color faces are included.")
32
33 (let ((class '((class color) (min-colors 89)))
34 (orange "#e69f00")
35 (skyblue "#56b4e9")
36 (bluegreen "#009e73")
37 (yellow "#f8ec59")
38 (blue "#0072b2")
39 (vermillion "#d55e00")
40 (redpurple "#cc79a7")
41 (bluegray "#848ea9"))
42 (custom-theme-set-faces
43 'dichromacy
44 `(default ((,class (:foreground "black" :background "white"))))
45 `(cursor ((,class (:foreground "white" :background "black"))))
46 ;; Highlighting faces
47 `(fringe ((,class (:background "#f7f7f7"))))
48 `(highlight ((,class (:foreground ,blue :background "#e5e5e5"))))
49 `(region ((,class (:foreground unspecified :background ,yellow))))
50 `(secondary-selection ((,class (:background "#e5e5e5"))))
51 `(isearch ((,class (:foreground "white" :background ,vermillion))))
52 `(lazy-highlight ((,class (:foreground "white" :background ,redpurple))))
53 `(trailing-whitespace ((,class (:background ,vermillion))))
54 ;; Mode line faces
55 `(mode-line ((,class (:box (:line-width -1 :style released-button)
56 :background "#e5e5e5" :foreground "black"))))
57 `(mode-line-inactive ((,class (:box (:line-width -1 :style released-button)
58 :background "#b0b0b0"
59 :foreground "black"))))
60 ;; Escape and prompt faces
61 `(minibuffer-prompt ((,class (:weight bold :foreground ,blue))))
62 `(escape-glyph ((,class (:foreground ,vermillion))))
63 ;; Font lock faces
64 `(font-lock-builtin-face ((,class (:foreground ,blue))))
65 `(font-lock-comment-face ((,class (:slant italic :foreground ,bluegreen))))
66 `(font-lock-constant-face ((,class (:weight bold :foreground ,vermillion))))
67 `(font-lock-function-name-face ((,class (:foreground ,vermillion))))
68 `(font-lock-keyword-face ((,class (:weight bold :foreground ,skyblue))))
69 `(font-lock-string-face ((,class (:foreground ,bluegray))))
70 `(font-lock-type-face ((,class (:weight bold :foreground ,blue))))
71 `(font-lock-variable-name-face ((,class (:weight bold :foreground ,orange))))
72 `(font-lock-warning-face ((,class (:weight bold :slant italic
73 :foreground ,vermillion))))
74 ;; Button and link faces
75 `(button ((,class (:underline t :foreground ,blue))))
76 `(link ((,class (:underline t :foreground ,blue))))
77 `(link-visited ((,class (:underline t :foreground ,redpurple))))
78 ;; Gnus faces
79 `(gnus-group-news-1 ((,class (:weight bold :foreground ,vermillion))))
80 `(gnus-group-news-1-low ((,class (:foreground ,vermillion))))
81 `(gnus-group-news-2 ((,class (:weight bold :foreground ,orange))))
82 `(gnus-group-news-2-low ((,class (:foreground ,orange))))
83 `(gnus-group-news-3 ((,class (:weight bold :foreground ,skyblue))))
84 `(gnus-group-news-3-low ((,class (:foreground ,skyblue))))
85 `(gnus-group-news-4 ((,class (:weight bold :foreground ,redpurple))))
86 `(gnus-group-news-4-low ((,class (:foreground ,redpurple))))
87 `(gnus-group-news-5 ((,class (:weight bold :foreground ,blue))))
88 `(gnus-group-news-5-low ((,class (:foreground ,blue))))
89 `(gnus-group-news-low ((,class (:foreground ,bluegreen))))
90 `(gnus-group-mail-1 ((,class (:weight bold :foreground ,vermillion))))
91 `(gnus-group-mail-1-low ((,class (:foreground ,vermillion))))
92 `(gnus-group-mail-2 ((,class (:weight bold :foreground ,orange))))
93 `(gnus-group-mail-2-low ((,class (:foreground ,orange))))
94 `(gnus-group-mail-3 ((,class (:weight bold :foreground ,skyblue))))
95 `(gnus-group-mail-3-low ((,class (:foreground ,skyblue))))
96 `(gnus-group-mail-low ((,class (:foreground ,bluegreen))))
97 `(gnus-header-content ((,class (:foreground ,redpurple))))
98 `(gnus-header-from ((,class (:weight bold :foreground ,blue))))
99 `(gnus-header-subject ((,class (:foreground ,orange))))
100 `(gnus-header-name ((,class (:foreground ,skyblue))))
101 `(gnus-header-newsgroups ((,class (:foreground ,vermillion))))
102 ;; Message faces
103 `(message-header-name ((,class (:foreground ,skyblue))))
104 `(message-header-cc ((,class (:foreground ,vermillion))))
105 `(message-header-other ((,class (:foreground ,bluegreen))))
106 `(message-header-subject ((,class (:foreground ,orange))))
107 `(message-header-to ((,class (:weight bold :foreground ,blue))))
108 `(message-cited-text ((,class (:slant italic :foreground ,bluegreen))))
109 `(message-separator ((,class (:weight bold :foreground ,redpurple))))
110 ;; Flyspell
111 `(flyspell-duplicate ((,class (:weight unspecified :foreground unspecified
112 :slant unspecified :underline ,orange))))
113 `(flyspell-incorrect ((,class (:weight unspecified :foreground unspecified
114 :slant unspecified :underline ,redpurple)))))
115
116 (custom-theme-set-variables
117 'dichromacy
118 `(ansi-color-names-vector ["black" ,vermillion ,bluegreen ,yellow
119 ,blue ,redpurple ,skyblue "white"])))
120
121 (provide-theme 'dichromacy)
122
123 ;; Local Variables:
124 ;; no-byte-compile: t
125 ;; End:
126
127 ;;; dichromacy-theme.el ends here