1 ;;; BTCSB-theme.el --- Baby, the Code Shines Bright -*- lexical-binding: t; -*-
3 ;; Author: Joe Wreschnig
4 ;; Package-Version: 20170806
5 ;; Package-Requires: ((emacs "24"))
8 ;; This is free and unencumbered software released into the public
9 ;; domain. Anyone is free to copy, modify, publish, use, compile,
10 ;; sell, or distribute this software, either in source code form or as
11 ;; a compiled binary, for any purpose, commercial or non-commercial,
16 ;; "Baby, The Code Shines Bright" is an Emacs adaptation of Jessica
17 ;; Allen's TextMate theme of the same name, which is in turn a
18 ;; TextMate adaptation of frilly dresses.
20 ;; Because Emacs is not TextMate, it doesn't look exactly the same,
21 ;; but it uses the same color palette and basic color choices.
27 (deftheme BTCSB "Baby, The Code Shines Bright theme
29 Baby, The Code Shines Bright is an Emacs adaptation of Jessica
30 Allen's TextMate theme of the same name, a pastel-on-dark color
31 palette inspired by lolita dresses. URL
32 `http://spacekat.github.com/blog/2010/08/26/cute-code-overload/'
34 That's in turn a TextMate adaptation of frilly dresses. URL
35 `http://www.babyssb.co.jp/'
37 The theme doesn't provide a default font family or size, but
38 recommended pairings are Fantasque Sans or Monaco.")
40 (defun BTCSB-theme-dim (color dark desaturate)
41 "Darken COLOR by DARK and desaturate it by DESATURATE."
42 (color-desaturate-name (color-darken-name color dark) desaturate))
44 (let (;; These are the colors from the original TextMate theme, along
45 ;; with what they were used for. These do not map cleanly either
46 ;; way to Emacs faces (I'm not sure what a "CSS constructor
47 ;; argument" even is) so the comments are more for reference
48 ;; back to the original file than any current use.
50 ;; "Support" refers to built-ins along with interfaces which are
51 ;; part of standard libraries; Emacs modes generally do not
52 ;; distinguish between library and client code.
54 ;; Most colors that were used as background colors are instead
55 ;; used as accents (e.g. underline and fringe), because Emacs
56 ;; doesn't blend colors when given multiple faces. Background
57 ;; colors are reserved for short-lived states that need
58 ;; immediate attention, e.g. region and search selection.
60 ;; TODO: Several of these colors are too dark to be reasonable,
61 ;; even if I assume they were in Generic RGB γ=2.2 originally.
62 ;; Also a few are indistinguishable to me on the displays
63 ;; I've tested so far (e.g. the two bright yellows). We could
64 ;; either merge them or pick a few more shades from more recent
65 ;; Baby design palettes.
67 (clr01 "#000000") ; background
68 (clr02 "#041C1A") ; line highlight
69 (clr03 "#1C1C1C") ; CSS constructor background
71 (clr04 "#F6F6F6") ; default foreground
72 (clr05 "#3E3E3E") ; precomposed "invisibles" foreground
73 (clr06 "#FFFFFF") ; caret
75 (clr07 "#4D605F") ; comment
76 (clr08 "#8693A5") ; CSS @at-rule
77 (clr09 "#9CA8D4") ; deprecated foreground
79 (clr10 "#D99ED1") ; entity
80 (clr11 "#DE99BF") ; support function, CSS property value
81 (clr12 "#F465B6") ; variable, string variable, CSS additional constant
83 (clr13 "#94579E") ; keyword
84 (clr14 "#9C69F6") ; regexp special
85 (clr15 "#A768EF") ; selection overlay
86 (clr16 "#442A61") ; premultiplied selection overlay, 41% opacity
88 (clr17 "#B3F382") ; string constant, support constant, CSS pseudo-class
89 (clr18 "#BFF294") ; constant
91 (clr19 "#FFC53B") ; old selection highlight at 48% opacity
92 (clr20 "#F9EE99") ; regexp
93 (clr21 "#FFF39E") ; storage (i.e. type)
95 (clr22 "#2A1852") ; deprecated background
96 (clr23 "#4B7FD4") ; support, inheritance, CSS constructor argument
97 (clr24 "#5BB5D0") ; CSS class name
98 (clr25 "#61C8C3") ; strings, embedded source
99 (clr26 "#9CEFF2") ; CSS tag name, ID
100 (clr27 "#D44741") ; illegal background
102 ;; Additional colors from a variant by Zak Remer
103 (clr28 "#240C29") ; alternate line highlight
104 (clr29 "#100E2D") ; alternate highlight
105 (clr30 "#DB558F") ; alternate storage modifier
108 (custom-theme-set-faces
112 `(button ((t (:inherit (link)))))
113 `(cursor ((t (:background ,clr06))))
114 `(default ((t (:background ,clr01 :foreground ,clr04))))
115 `(error ((t (:foreground ,clr27))))
116 `(escape-glyph ((t (:foreground ,clr18))))
117 `(fringe ((t (:background ,clr03))))
118 ;; `(header TODO: I don't use this....)
119 `(highlight ((t (:background ,clr16))))
120 `(isearch ((t (:background ,clr15))))
121 `(lazy-highlight ((t (:background ,clr09))))
122 `(link ((t (:foreground ,clr26 :underline t))))
123 `(link-visited ((t (:inherit link :foreground ,clr25))))
124 `(match ((t (:inherit (lazy-highlight)))))
125 `(menu ((t (:background ,clr29))))
126 `(minibuffer-prompt ((t (:foreground ,clr17))))
127 `(mode-line ((t (:background ,clr14 :foreground ,clr02))))
128 `(mode-line-buffer-id ((t (:weight bold :foreground ,clr01))))
129 `(mode-line-emphasis ((t (:weight bold))))
130 `(mode-line-highlight ((t (:foreground ,clr21))))
131 `(mode-line-inactive ((t (:background ,(BTCSB-theme-dim clr14 25 55)
132 :inherit mode-line))))
133 `(nobreak-space ((t (:foreground ,clr05 :underline t))))
134 `(region ((t (:background ,clr16))))
135 `(secondary-selection ((t (:inherit (region)))))
136 `(shadow ((t (:foreground ,clr08))))
137 `(success ((t (:foreground ,clr17))))
138 `(trailing-whitespace ((t (:background ,clr22))))
139 `(tty-menu-enabled-face ((t (:foreground ,clr04 :background ,clr16))))
140 `(tty-menu-selected-face ((t (:foreground ,clr04 :background ,clr15))))
141 `(tty-menu-disabled-face ((t (:foreground ,clr08 :background ,clr16))))
142 `(warning ((t (:foreground ,clr19))))
145 `(font-lock-builtin-face ((t (:foreground ,clr23))))
146 `(font-lock-comment-delimiter-face ((t (:inherit (font-lock-comment-face)))))
147 `(font-lock-comment-face ((t (:foreground ,clr07))))
148 `(font-lock-constant-face ((t (:foreground ,clr18))))
149 `(font-lock-doc-face ((t (:foreground ,clr24))))
150 `(font-lock-function-name-face ((t (:foreground ,clr11))))
151 `(font-lock-keyword-face ((t (:foreground ,clr13))))
152 `(font-lock-negation-char-face ((t nil)))
153 `(font-lock-preprocessor-face ((t (:inherit (font-lock-builtin-face)))))
154 `(font-lock-regexp-grouping-backslash ((t :foreground ,clr08)))
155 `(font-lock-regexp-grouping-construct ((t :foreground ,clr08)))
156 `(font-lock-string-face ((t (:foreground ,clr25))))
157 `(font-lock-type-face ((t (:foreground ,clr21))))
158 `(font-lock-variable-name-face ((t (:foreground ,clr12))))
159 `(font-lock-warning-face ((t (:foreground ,clr20))))
161 ;; Highlighted Line Face
162 `(hl-line ((t (:background ,clr28))))
164 ;; Matching / I-search Faces
165 `(isearch-fail ((t (:foreground ,clr09))))
166 `(query-replace ((t (:inherit (isearch)))))
168 ;; Flyspell Mode Faces
169 `(flyspell-incorrect ((t (:underline (:color ,clr27 :style wave)))))
170 ;; Repeating a mistake doesn't make it right.
171 `(flyspell-duplicate ((t (:inherit (flyspell-incorrect)))))
174 `(flycheck-error ((t (:underline (:color ,clr27 :style wave)))))
175 `(flycheck-error-list-error ((t (:foreground ,clr27))))
176 `(flycheck-fringe-error ((t (:foreground ,clr27))))
177 `(flycheck-warning ((t (:underline (:color ,clr19 :style wave)))))
178 `(flycheck-error-list-warning ((t (:foreground ,clr20))))
179 `(flycheck-fringe-warning ((t (:foreground ,clr20))))
180 `(flycheck-info ((t (:underline (:color ,clr24 :style wave)))))
181 `(flycheck-error-list-info ((t (:foreground ,clr24))))
182 `(flycheck-fringe-info ((t (:foreground ,clr24))))
183 `(flycheck-error-list-id ((t (:inherit (font-lock-constant-face)))))
184 `(flycheck-error-list-checker-name ((t (:foreground ,clr11))))
187 `(powerline-active1 ((t (:background ,clr13))))
188 `(powerline-active2 ((t (:background ,clr22))))
189 `(powerline-inactive1 ((t (:background ,clr16))))
190 `(powerline-inactive2 ((t (:background ,clr29))))
191 `(mode-line-buffer-id-inactive ((t (:inherit mode-line-inactive))))
193 ;; Pp^l Highlight Face - it's like a comment, I guess? I'm never
194 ;; happy with how this looks except that I'm always happier to see
195 ;; it than a literal ^L.
196 `(pp^L-highlight ((t (:box (:color ,clr07)))))
198 ;; Spar^L Mode Face. It's called "shines bright" after all.
199 `(spar^l-mode ((t (:foreground ,clr30))))
202 `(magit-section-highlight ((t (:inherit (region)))))
205 `(web-mode-html-tag-face ((t (:foreground ,clr11))))
206 `(web-mode-html-attr-name-face ((t (:foreground ,clr11))))
207 `(web-mode-html-entity-face ((t (:foreground ,clr10))))
208 `(web-mode-html-attr-equal-face ((t (:inherit (shadow)))))
209 `(web-mode-css-selector-face ((t (:foreground ,clr26))))
210 `(web-mode-css-pseudo-class-face ((t (:foreground ,clr17))))
212 ;; Mail, elfeed, etc.
213 `(message-header-name ((t (:foreground ,clr14))))
214 `(message-header-subject ((t (:foreground ,clr09))))
215 `(message-header-to ((t (:foreground ,clr09))))
216 `(message-header-other ((t (:foreground ,clr08))))
217 `(shr-link ((t (:foreground ,clr24))))
222 (add-to-list 'custom-theme-load-path
223 (file-name-directory load-file-name)))
225 (provide-theme 'BTCSB)
226 (provide 'BTCSB-theme)
228 ;;; BTCSB-theme.el ends here