You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
6.0 KiB

  1. ;; This program is free software; you can redistribute it and/or modify
  2. ;; it under the terms of the GNU General Public License as published by
  3. ;; the Free Software Foundation, either version 3 of the License, or
  4. ;; (at your option) any later version.
  5. ;; This program is distributed in the hope that it will be useful,
  6. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. ;; GNU General Public License for more details.
  9. ;; You should have received a copy of the GNU General Public License
  10. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  11. ;; ---------------------------
  12. ;;
  13. ;; Ritchie: A light color theme, named after Dennis Ritchie, creator
  14. ;; of the C language, co-creator of the Unix OS, among other things.
  15. ;;
  16. ;; ----------------------------
  17. ;;; Code:
  18. (unless (>= emacs-major-version 24)
  19. (error "requires Emacs 24 or later."))
  20. (deftheme ritchie "Uncertain amount of shades of blue.")
  21. (defvar ritchie-colours-alist
  22. nil
  23. "Colours for the Ritchie theme")
  24. (setq ritchie-colours-alist
  25. '((the-colour . "#0087af")
  26. (dark-cyan . "#008B8B")
  27. (white . "#ffffff")
  28. (dark-red . "#8B0000")
  29. (powder-blue . "#B0E0E6")
  30. (black . "#343434")
  31. (light-cyan . "#B0E0E6")
  32. (dodger-blue . "#104E8B")
  33. (royal-blue . "#4169E1")
  34. (dark-slate-blue . "#483D8B")
  35. (gainsboro . "#DCDCDC")
  36. (medium-blue . "#0000CD")))
  37. (defun ritchie-colour (name)
  38. "Shortcut to get a colour for ``ritchie-colours-alist'' by NAME."
  39. (cdr (assoc name ritchie-colours-alist)))
  40. (let* ((*background* (ritchie-colour 'white))
  41. (*normal* (ritchie-colour 'black))
  42. (*comments* (ritchie-colour 'dodger-blue))
  43. (*constant* (ritchie-colour 'medium-blue))
  44. (*current-line* (ritchie-colour 'powder-blue))
  45. (*current-line-fg* *normal*)
  46. (*cursor-underscore* (ritchie-colour 'black))
  47. (*keywords* (ritchie-colour 'dark-slate-blue))
  48. (*line-number* *background*)
  49. (*line-number-fg* (ritchie-colour 'gainsboro))
  50. (*method-declaration* *keywords*)
  51. (*mode-line-bg* (ritchie-colour 'dark-cyan))
  52. (*mode-line-fg* *background*)
  53. (*mode-inactive-bg* (ritchie-colour 'light-cyan))
  54. (*mode-inactive-fg* *normal*)
  55. (*number* *normal*)
  56. (*operators* *normal*)
  57. (*warning* "#3b5998")
  58. (*regexp* "#E9C")
  59. (*string* *normal*)
  60. (*variable* *method-declaration*)
  61. (*visual-selection* (ritchie-colour 'the-colour))
  62. (*visual-selection-fg* *background*)
  63. (*header-line-bg* *visual-selection*))
  64. (custom-theme-set-faces
  65. 'ritchie
  66. `(bold ((t (:bold t))))
  67. `(button ((t (:foreground, *keywords* :underline t))))
  68. `(default ((t (:background, *background* :foreground, *normal*))))
  69. ;; Colour of header lines in Proced, info, Buffer list etc...
  70. `(header-line ((t (:background, *header-line-bg* :foreground, *background*))))
  71. `(highlight ((t (:background, *current-line* :foreground, *current-line-fg*))))
  72. `(highlight-face ((t (:background, *current-line*))))
  73. `(hl-line ((t (:background, *current-line* :underline nil
  74. :foreground ,*current-line-fg*))))
  75. `(info-xref ((t (:foreground, *keywords* :underline t))))
  76. `(region ((t (:background, *visual-selection* :foreground ,*visual-selection-fg*))))
  77. `(underline ((nil (:underline t))))
  78. ;; font-lock
  79. `(font-lock-builtin-face ((t (:foreground, *operators*))))
  80. `(font-lock-comment-delimiter-face ((t (:foreground, *comments*))))
  81. `(font-lock-comment-face ((t (:foreground, *comments*))))
  82. `(font-lock-constant-face ((t (:foreground, *constant*))))
  83. `(font-lock-doc-face ((t (:foreground, *string*))))
  84. `(font-lock-doc-string-face ((t (:foreground, *string*))))
  85. `(font-lock-function-name-face ((t (:foreground, *method-declaration*))))
  86. `(font-lock-keyword-face ((t (:foreground, *keywords*))))
  87. `(font-lock-negation-char-face ((t (:foreground, *warning*))))
  88. `(font-lock-number-face ((t (:foreground, *number*))))
  89. `(font-lock-preprocessor-face ((t (:foreground, *keywords*))))
  90. `(font-lock-reference-face ((t (:foreground, *constant*))))
  91. `(font-lock-regexp-grouping-backslash ((t (:foreground, *regexp*))))
  92. `(font-lock-regexp-grouping-construct ((t (:foreground, *regexp*))))
  93. `(font-lock-string-face ((t (:foreground, *string*))))
  94. `(font-lock-type-face ((t (:foreground, *operators*))))
  95. `(font-lock-variable-name-face ((t (:foreground, *variable*))))
  96. `(font-lock-warning-face ((t (:foreground, *warning*))))
  97. ;; GUI
  98. `(fringe ((t (:background, *background*))))
  99. `(linum ((t (:background, *line-number* :foreground ,*line-number-fg*))))
  100. `(minibuffer-prompt ((t (:foreground, *variable*))))
  101. `(mode-line ((t (:background, *mode-line-bg* :foreground, *mode-line-fg* :box nil))))
  102. `(mode-line-inactive ((t (:background, *mode-inactive-bg*
  103. :foreground, *mode-inactive-fg* :box nil))))
  104. `(cursor ((t (:background, *cursor-underscore*))))
  105. `(text-cursor ((t (:background, *cursor-underscore*))))
  106. `(vertical-border ((t (:foreground, *background*)))) ;; between splits
  107. ;; show-paren
  108. `(show-paren-mismatch ((t (:background, *warning* :foreground, *normal* :weight bold))))
  109. `(show-paren-match ((t (:background, *keywords* :foreground, *normal* :weight bold))))
  110. ;; search
  111. `(isearch ((t (:background, *header-line-bg* :foreground, *background*))))
  112. `(isearch-fail ((t (:background, *warning*))))
  113. `(lazy-highlight ((t (:background, *operators* :foreground, *visual-selection*))))
  114. ))
  115. ;;;###autoload
  116. (when (and (boundp 'custom-theme-load-path) load-file-name)
  117. (add-to-list 'custom-theme-load-path
  118. (file-name-as-directory (file-name-directory load-file-name))))
  119. (provide-theme 'ritchie)
  120. ;; Local Variables:
  121. ;; no-byte-compile: t
  122. ;; End: