Add special faces for Git commit lines
[BTCSB-emacs-theme.git] / BTCSB-theme.el
1 ;;; BTCSB-theme.el --- Baby, the Code Shines Bright -*- lexical-binding: t; -*-
2 ;;
3 ;; Author: Joe Wreschnig
4 ;; Package-Version: 20170806
5 ;; Package-Requires: ((emacs "24"))
6 ;; Keywords: faces
7 ;; URL: https://git.korewanetadesu.com/BTCSB-theme.git
8 ;;
9 ;; This is free and unencumbered software released into the public
10 ;; domain. Anyone is free to copy, modify, publish, use, compile,
11 ;; sell, or distribute this software, either in source code form or as
12 ;; a compiled binary, for any purpose, commercial or non-commercial,
13 ;; and by any means.
14 \f
15 ;;; Commentary:
16 ;;
17 ;; "Baby, The Code Shines Bright" is an Emacs adaptation of Jessica
18 ;; Allen's TextMate theme of the same name, which is in turn a
19 ;; TextMate adaptation of frilly dresses.
20 ;;
21 ;; Because Emacs is not TextMate, it doesn't look exactly the same,
22 ;; but it uses the same color palette and basic color choices.
23 \f
24 ;;; Code:
25
26 (require 'color)
27
28 (deftheme BTCSB "Baby, The Code Shines Bright theme
29
30 Baby, The Code Shines Bright is an Emacs adaptation of Jessica
31 Allen's TextMate theme of the same name, a pastel-on-dark color
32 palette inspired by lolita dresses. URL
33 `http://spacekat.github.com/blog/2010/08/26/cute-code-overload/'
34
35 That's in turn a TextMate adaptation of frilly dresses. URL
36 `http://www.babyssb.co.jp/'
37
38 The theme doesn't provide a default font family or size, but
39 recommended pairings are Fantasque Sans or Monaco.")
40
41 (defun BTCSB-theme-dim (color dark desaturate)
42 "Darken COLOR by DARK and desaturate it by DESATURATE."
43 (color-desaturate-name (color-darken-name color dark) desaturate))
44
45 (let (;; These are the colors from the original TextMate theme, along
46 ;; with what they were used for. These do not map cleanly either
47 ;; way to Emacs faces (I'm not sure what a "CSS constructor
48 ;; argument" even is) so the comments are more for reference
49 ;; back to the original file than any current use.
50 ;;
51 ;; "Support" refers to built-ins along with interfaces which are
52 ;; part of standard libraries; Emacs modes generally do not
53 ;; distinguish between library and client code.
54 ;;
55 ;; Most colors that were used as background colors are instead
56 ;; used as accents (e.g. underline and fringe), because Emacs
57 ;; doesn't blend colors when given multiple faces. Background
58 ;; colors are reserved for short-lived states that need
59 ;; immediate attention, e.g. region and search selection.
60
61 ;; TODO: Several of these colors are too dark to be reasonable,
62 ;; even if I assume they were in Generic RGB γ=2.2 originally.
63 ;; Also a few are indistinguishable to me on the displays
64 ;; I've tested so far (e.g. the two bright yellows). We could
65 ;; either merge them or pick a few more shades from more recent
66 ;; Baby design palettes.
67
68 (clr01 "#000000") ; background
69 (clr02 "#041C1A") ; line highlight
70 (clr03 "#1C1C1C") ; CSS constructor background
71
72 (clr04 "#F6F6F6") ; default foreground
73 (clr05 "#3E3E3E") ; precomposed "invisibles" foreground
74 (clr06 "#FFFFFF") ; caret
75
76 (clr07 "#4D605F") ; comment
77 (clr08 "#8693A5") ; CSS @at-rule
78 (clr09 "#9CA8D4") ; deprecated foreground
79
80 (clr10 "#D99ED1") ; entity
81 (clr11 "#DE99BF") ; support function, CSS property value
82 (clr12 "#F465B6") ; variable, string variable, CSS additional constant
83
84 (clr13 "#94579E") ; keyword
85 (clr14 "#9C69F6") ; regexp special
86 (clr15 "#A768EF") ; selection overlay
87 (clr16 "#442A61") ; premultiplied selection overlay, 41% opacity
88
89 (clr17 "#B3F382") ; string constant, support constant, CSS pseudo-class
90 (clr18 "#BFF294") ; constant
91
92 (clr19 "#FFC53B") ; old selection highlight at 48% opacity
93 (clr20 "#F9EE99") ; regexp
94 (clr21 "#FFF39E") ; storage (i.e. type)
95
96 (clr22 "#2A1852") ; deprecated background
97 (clr23 "#4B7FD4") ; support, inheritance, CSS constructor argument
98 (clr24 "#5BB5D0") ; CSS class name
99 (clr25 "#61C8C3") ; strings, embedded source
100 (clr26 "#9CEFF2") ; CSS tag name, ID
101 (clr27 "#D44741") ; illegal background
102
103 ;; Additional colors from a variant by Zak Remer
104 (clr28 "#240C29") ; alternate line highlight
105 (clr29 "#100E2D") ; alternate highlight
106 (clr30 "#DB558F") ; alternate storage modifier
107 )
108
109 (custom-theme-set-faces
110 'BTCSB
111
112 ;; Basic Faces
113 `(button ((t (:inherit (link)))))
114 `(cursor ((t (:background ,clr06))))
115 `(default ((t (:background ,clr01 :foreground ,clr04))))
116 `(error ((t (:foreground ,clr27))))
117 `(escape-glyph ((t (:foreground ,clr18))))
118 `(fringe ((t (:background ,clr03))))
119 `(header-line ((t (:background ,clr02 :foreground ,clr08))))
120 `(highlight ((t (:background ,clr16))))
121 `(isearch ((t (:background ,clr15))))
122 `(lazy-highlight ((t (:background ,clr09))))
123 `(link ((t (:foreground ,clr26 :underline t))))
124 `(link-visited ((t (:inherit link :foreground ,clr25))))
125 `(match ((t (:inherit (lazy-highlight)))))
126 `(menu ((t (:background ,clr29))))
127 `(minibuffer-prompt ((t (:foreground ,clr17))))
128 `(mode-line ((t (:background ,clr14 :foreground ,clr02))))
129 `(mode-line-buffer-id ((t (:weight bold :foreground ,clr01))))
130 `(mode-line-emphasis ((t (:weight bold))))
131 `(mode-line-highlight ((t (:foreground ,clr21))))
132 `(mode-line-inactive ((t (:background ,(BTCSB-theme-dim clr14 25 55)
133 :inherit mode-line))))
134 `(nobreak-space ((t (:foreground ,clr05 :underline t))))
135 `(region ((t (:background ,clr16))))
136 `(secondary-selection ((t (:inherit (region)))))
137 `(shadow ((t (:foreground ,clr08))))
138 `(success ((t (:foreground ,clr17))))
139 `(trailing-whitespace ((t (:background ,clr22))))
140 `(tty-menu-enabled-face ((t (:foreground ,clr04 :background ,clr16))))
141 `(tty-menu-selected-face ((t (:foreground ,clr04 :background ,clr15))))
142 `(tty-menu-disabled-face ((t (:foreground ,clr08 :background ,clr16))))
143 `(warning ((t (:foreground ,clr19))))
144
145 ;; Font Lock Faces
146 `(font-lock-builtin-face ((t (:foreground ,clr23))))
147 `(font-lock-comment-delimiter-face ((t (:inherit (font-lock-comment-face)))))
148 `(font-lock-comment-face ((t (:foreground ,clr07))))
149 `(font-lock-constant-face ((t (:foreground ,clr18))))
150 `(font-lock-doc-face ((t (:foreground ,clr24))))
151 `(font-lock-function-name-face ((t (:foreground ,clr11))))
152 `(font-lock-keyword-face ((t (:foreground ,clr13))))
153 `(font-lock-negation-char-face ((t nil)))
154 `(font-lock-preprocessor-face ((t (:inherit (font-lock-builtin-face)))))
155 `(font-lock-regexp-grouping-backslash ((t :foreground ,clr08)))
156 `(font-lock-regexp-grouping-construct ((t :foreground ,clr08)))
157 `(font-lock-string-face ((t (:foreground ,clr25))))
158 `(font-lock-type-face ((t (:foreground ,clr21))))
159 `(font-lock-variable-name-face ((t (:foreground ,clr12))))
160 `(font-lock-warning-face ((t (:foreground ,clr20))))
161
162 ;; Highlighted Line Face
163 `(hl-line ((t (:background ,clr28))))
164
165 ;; Matching / I-search Faces
166 `(isearch-fail ((t (:foreground ,clr09))))
167 `(query-replace ((t (:inherit (isearch)))))
168
169 ;; Flyspell Mode Faces
170 `(flyspell-incorrect ((t (:underline (:color ,clr27 :style wave)))))
171 ;; Repeating a mistake doesn't make it right.
172 `(flyspell-duplicate ((t (:inherit (flyspell-incorrect)))))
173
174 ;; Flycheck Faces
175 `(flycheck-error ((t (:underline (:color ,clr27 :style wave)))))
176 `(flycheck-error-list-error ((t (:foreground ,clr27))))
177 `(flycheck-fringe-error ((t (:foreground ,clr27))))
178 `(flycheck-warning ((t (:underline (:color ,clr19 :style wave)))))
179 `(flycheck-error-list-warning ((t (:foreground ,clr20))))
180 `(flycheck-fringe-warning ((t (:foreground ,clr20))))
181 `(flycheck-info ((t (:underline (:color ,clr24 :style wave)))))
182 `(flycheck-error-list-info ((t (:foreground ,clr24))))
183 `(flycheck-fringe-info ((t (:foreground ,clr24))))
184 `(flycheck-error-list-id ((t (:inherit (font-lock-constant-face)))))
185 `(flycheck-error-list-checker-name ((t (:foreground ,clr11))))
186
187 ;; Powerline Faces
188 `(powerline-active1 ((t (:background ,clr13))))
189 `(powerline-active2 ((t (:background ,clr22))))
190 `(powerline-inactive1 ((t (:background ,clr16))))
191 `(powerline-inactive2 ((t (:background ,clr29))))
192 `(mode-line-buffer-id-inactive ((t (:inherit mode-line-inactive))))
193
194 ;; Pp^l Highlight Face - it's like a comment, I guess? I'm never
195 ;; happy with how this looks except that I'm always happier to see
196 ;; it than a literal ^L.
197 `(pp^L-highlight ((t (:box (:color ,clr07)))))
198
199 ;; Spar^L Mode Face. It's called "shines bright" after all.
200 `(spar^l-mode ((t (:foreground ,clr30))))
201
202 ;; Magit Faces
203 `(magit-section-highlight ((t (:inherit (region)))))
204 `(git-commit-summary ((t (:foreground ,clr09))))
205 `(git-commit-overlong-summary ((t (:inherit (error)))))
206 `(git-commit-nonempty-second-line ((t (:inherit (error)))))
207
208 ;; Web Mode Faces
209 `(web-mode-html-tag-face ((t (:foreground ,clr11))))
210 `(web-mode-html-attr-name-face ((t (:foreground ,clr11))))
211 `(web-mode-html-entity-face ((t (:foreground ,clr10))))
212 `(web-mode-html-attr-equal-face ((t (:inherit (shadow)))))
213 `(web-mode-css-selector-face ((t (:foreground ,clr26))))
214 `(web-mode-css-pseudo-class-face ((t (:foreground ,clr17))))
215
216 ;; SHR, EWW, etc.
217 `(shr-link ((t (:foreground ,clr24))))
218
219 ;; Mail, elfeed, etc.
220 `(message-header-name ((t (:foreground ,clr07))))
221 `(message-header-subject ((t (:foreground ,clr04))))
222 `(message-header-to ((t (:foreground ,clr04))))
223 `(message-header-other ((t (:foreground ,clr23))))
224
225 ;; Elfeed
226 `(elfeed-search-date-face ((t (:foreground ,clr07))))
227 `(elfeed-search-title-face ((t (:foreground ,clr04))))
228 `(elfeed-search-unread-title-face ((t (:foreground ,clr26))))
229 `(elfeed-search-feed-face ((t (:foreground ,clr23))))
230 `(elfeed-search-tag-face ((t (:foreground ,clr21))))
231 `(elfeed-search-last-update-face ((t (:foreground ,clr08))))
232 `(elfeed-search-unread-count-face ((t (:foreground ,clr18))))
233 `(elfeed-search-filter-face ((t (:foreground ,clr20))))
234
235 ;; Jabber.el
236 `(jabber-rare-time-face ((t (:inherit (variable-pitch)
237 :foreground ,clr08))))
238 `(jabber-chat-text-foreign ((t (:inherit (variable-pitch)))))
239 `(jabber-chat-text-local ((t (:inherit (variable-pitch)))))
240 `(jabber-chat-prompt-foreign ((t (:inherit (jabber-chat-text-foreign)
241 :foreground ,clr14))))
242 `(jabber-chat-prompt-local ((t (:inherit (jabber-chat-text-local)
243 :foreground ,clr13))))
244 `(jabber-chat-prompt-system ((t (:inherit (variable-pitch)
245 :foreground ,clr23))))
246 `(jabber-chat-error ((t (:inherit (variable-pitch)
247 :foreground ,clr27))))
248 `(jabber-roster-user-online ((t (:inherit (default)
249 :foreground ,clr17))))
250 `(jabber-roster-user-xa ((t (:inherit (default)
251 :foreground ,clr09))))
252 `(jabber-roster-user-dnd ((t (:inherit (default)
253 :foreground ,clr09))))
254 `(jabber-roster-user-away ((t (:inherit (default)
255 :foreground ,clr09))))
256 `(jabber-roster-user-chatty ((t (:inherit (default)
257 :foreground ,clr21))))
258 `(jabber-roster-user-error ((t (:inherit (default)
259 :foreground ,clr27))))
260 `(jabber-roster-user-offline ((t (:inherit (default)
261 :foreground ,clr07))))
262 `(jabber-title-small ((t (:inherit (variable-pitch)
263 :height 1.0
264 :foreground ,clr08))))
265 `(jabber-title-medium ((t (:inherit (variable-pitch)
266 :height 1.0 :weight bold
267 :foreground ,clr08))))
268 `(jabber-title-large ((t (:inherit (variable-pitch)
269 :height 1.5 :weight bold
270 :foreground ,clr08))))
271 ))
272
273 ;;;###autoload
274 (when load-file-name
275 (add-to-list 'custom-theme-load-path
276 (file-name-directory load-file-name)))
277
278 (provide-theme 'BTCSB)
279 (provide 'BTCSB-theme)
280
281 ;;; BTCSB-theme.el ends here