Add package URL header.
[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 TODO: I don't use this....)
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
205 ;; Web Mode Faces
206 `(web-mode-html-tag-face ((t (:foreground ,clr11))))
207 `(web-mode-html-attr-name-face ((t (:foreground ,clr11))))
208 `(web-mode-html-entity-face ((t (:foreground ,clr10))))
209 `(web-mode-html-attr-equal-face ((t (:inherit (shadow)))))
210 `(web-mode-css-selector-face ((t (:foreground ,clr26))))
211 `(web-mode-css-pseudo-class-face ((t (:foreground ,clr17))))
212
213 ;; SHR, EWW, etc.
214 `(shr-link ((t (:foreground ,clr24))))
215
216 ;; Mail, elfeed, etc.
217 `(message-header-name ((t (:foreground ,clr07))))
218 `(message-header-subject ((t (:foreground ,clr04))))
219 `(message-header-to ((t (:foreground ,clr04))))
220 `(message-header-other ((t (:foreground ,clr23))))
221
222 ;; Elfeed
223 `(elfeed-search-date-face ((t (:foreground ,clr07))))
224 `(elfeed-search-title-face ((t (:foreground ,clr04))))
225 `(elfeed-search-unread-title-face ((t (:foreground ,clr26))))
226 `(elfeed-search-feed-face ((t (:foreground ,clr23))))
227 `(elfeed-search-tag-face ((t (:foreground ,clr21))))
228 ))
229
230 ;;;###autoload
231 (when load-file-name
232 (add-to-list 'custom-theme-load-path
233 (file-name-directory load-file-name)))
234
235 (provide-theme 'BTCSB)
236 (provide 'BTCSB-theme)
237
238 ;;; BTCSB-theme.el ends here