dichromacy-theme.el 5.9 KB

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