Initial check-in of a dark variant for Refinery
[~bandali/refinery-theme] / refinery-dark-theme.el
CommitLineData
761ecca3
AB
1;;; refinery-dark-theme.el --- refined, minimalist, layered dark theme -*- lexical-binding: t; -*-
2
3;; Copyright (C) 2020 Amin Bandali
4
5;; Author: Amin Bandali <bandali@gnu.org>
6;; Version: 0.1.1
7;; Keywords: faces
8
9;; This program 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;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
21
22;;; Commentary:
23
24;; This is the dark variant of the Refinery theme. Please see
25;; `refinery.el' for the commentary.
26
27;;; Code:
28
29(deftheme refinery-dark
30 "A minimalist high-contrast dark theme for GNU Emacs.
31Includes themed faces for modes/packages like Isearch, Gnus,
32Message, EBDB, and Ivy.")
33
34(let* (;; supported classes of terminals
35 (class '((class color) (min-colors 16)))
36
37 ;; colors
38 (black "#000000")
39 (white "#ffffff")
40 (yellow "#ffffdf")
41 (yellow+1 "#dfdfaf")
42 (yellow+2 "#fce94f")
43 (grey "#e7e7e7")
44 (grey-0 "#222222")
45 (grey-1 "#666666")
46 (grey-2 "#888888")
47 (grey-3 "#bbbbbb")
48 (blue "#204a87")
49 (red "#ff4b4b") ; #d70000 ; #a40000
50 (orange "#ce5c00")
51 (green "#4e9a06")
52
53 ;; layers
54 (layer-2 `((,class (:foreground ,grey-2))))
55 (layer-1 `((,class (:foreground ,grey-1))))
56 (layer0 `((,class (:foreground ,grey-3 :background ,grey-0))))
57 (layer0-inv `((,class (:background ,white))))
58 (layer+1 `((,class (:foreground ,yellow :background ,black))))
59 (layer+2 `((,class (:foreground ,grey-3 :weight bold))))
60 (layer+3 `((,class (:foreground ,red))))
61 (layer+3b `((,class (:foreground ,red :weight bold))))
62 (layer+4 `((,class (:foreground ,red :background ,grey))))
63 (layer+4-inv `((,class (:foreground ,grey :background ,red))))
64 (layer+4b `((,class (:foreground ,red :background ,grey :weight bold))))
65 (layer+4b-inv `((,class (:foreground ,grey :background ,red :weight bold))))
66
67 ;; box
68 (box `(:line-width -1 :style released-button)))
69
70 (custom-theme-set-faces
71 'refinery-dark
72
73 `(default ,layer0)
74 `(cursor ,layer0-inv)
75
76 ;; Highlighting
77 `(linum ((,class (:background ,grey))))
78 `(fringe ((,class (:background ,black))))
79 `(highlight ((,class (:background ,yellow+2))))
80 `(hl-line ((,class (:background ,yellow+1))))
81 `(region ((,class (:background ,yellow+1))))
82 `(secondary-selection ((,class (:background ,yellow+2))))
83 `(isearch ((,class (:foreground ,white :background ,grey-1))))
84 `(lazy-highlight ((,class (:background ,grey))))
85 `(trailing-whitespace ,layer+4b-inv)
86 `(whitespace-trailing ,layer+4b-inv)
87
88 ;; Parens
89 `(show-paren-match ,layer+4b)
90 `(show-paren-mismatch ,layer+4b-inv)
91
92 ;; Comments and documentation
93 `(font-lock-comment-face ,layer+3)
94 `(font-lock-doc-face ,layer+3)
95
96 ;; Function definitions
97 `(font-lock-function-name-face ,layer+2)
98
99 ;; String literals
100 `(font-lock-string-face ,layer+1)
101
102 ;; Constants, variables, and their types
103 `(font-lock-constant-face ,layer0)
104 `(font-lock-variable-name-face ,layer0)
105 `(font-lock-type-face ,layer0)
106
107 ;; Built-ins and keywords
108 `(font-lock-builtin-face ,layer-1)
109 `(font-lock-keyword-face ,layer-2)
110
111 ;; Mode line and minibuffer prompt
112 `(mode-line ((,class (:background ,grey :box ,box))))
113 `(mode-line-inactive ((,class (:background "#e1e1e1" :box ,box))))
114 `(minibuffer-prompt ,layer+2)
115
116 ;; Characters displayed as sequences using `^' or `\'
117 `(escape-glyph ,layer+3)
118
119 ;; Gnus, Message, and EBDB
120 `(gnus-group-mail-3 ,layer+2)
121 `(gnus-group-mail-3-empty ,layer-1)
122 `(gnus-summary-normal-ticked ,layer+3)
123 `(gnus-header-from ,layer+3b)
124 `(gnus-header-subject ,layer+3)
125 `(gnus-header-name ,layer-2)
126 `(gnus-header-content ,layer0)
127 `(message-header-to ,layer+3b)
128 `(message-header-cc ,layer0)
129 `(message-header-subject ,layer0)
130 `(message-header-other ,layer-2)
131 `(message-header-name ,layer-2)
132 `(message-header-xheader ((,class (:foreground ,blue))))
133 `(ebdb-person-name ,layer+3b)
134
135 ;; Ivy and family
136 `(ivy-minibuffer-match-face-1 ((,class (:background "#eeeeee"))))
137 `(ivy-minibuffer-match-face-2 ((,class (:background ,grey :weight bold))))
138 `(ivy-minibuffer-match-face-3 ((,class (:background "light goldenrod" :weight semi-bold))))
139 `(ivy-minibuffer-match-face-4 ((,class (:background "misty rose" :weight semi-bold))))
140 `(ivy-current-match ((((class color) (background light))
141 :background "#d7d7d7" :foreground ,black)
142 (((class color) (background dark))
143 :background "#65a7e2" :foreground ,black)))
144
145 ;; Error/failure, warning, and success
146 `(error ,layer+3b)
147 `(warning ((,class (:foreground ,orange))))
148 `(success ((,class (:foreground ,green)))))
149
150 (custom-theme-set-variables 'refinery-dark))
151
152;;;###autoload
153(when (and (boundp 'custom-theme-load-path) load-file-name)
154 (add-to-list 'custom-theme-load-path
155 (file-name-as-directory
156 (file-name-directory load-file-name))))
157
158(provide-theme 'refinery-dark)
159;;; refinery-theme.el ends here