summaryrefslogtreecommitdiff
path: root/.config/emacs/mango-theme.el
blob: a18b9ce54690164d281b2a6954e7001a1e74f2b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
;;; mango-theme.el --- Just your average dark theme  -*- lexical-binding: t; -*-

(deftheme mango
  "Mildly dark, dark theme.
Your average not-so-dark dark theme, because none of the other options
were exactly to my liking.  It’s about time I had a theme to call my
own.")

(defsubst mango-theme--color (name)
  "Get the RGB value of the COLOR."
  (alist-get name mango-theme-colors-alist))

(defmacro mango-theme--generate-set-faces (&rest body)
  "A macro to provide a much simpler syntax than what is expected by
`custom-theme-set-faces'.  This is possible because I only run Emacs
graphically, so I shouldn’t need to have multiple specs per face.

\(fn SPEC...)"
  (declare (indent 0))
  (let ((ret '('mango custom-theme-set-faces)))
    (dolist (spec body)
      (add-to-list 'ret `(backquote
                          ,(list (car spec) `((((type graphic))
                                               ,(cdr spec)))))))
    (reverse ret)))

(defconst mango-theme-colors-alist
  '((foreground       . "#C5C8C6")
    (background       . "#2B303B")
    (background-cool  . "#363C4A")
    (background-dark  . "#1D2635")
    (background-faint . "#414859")
    (middleground     . "#4F5561")
    (disabled         . "#999999")
    (pale-azure       . "#9CDCFE")
    (celestial-blue   . "#569CD6")
    (violet           . "#E57AE5")
    (khaki            . "#F0E68C")
    (lime             . "#B8F182")
    (dark-red         . "#841A11")
    (orange           . "#F1B282")
    (pink             . "#ED97F5")
    (spanish-red      . "#E60026"))
  "The color palette used throughout the `mango-theme'.")

(mango-theme--generate-set-faces
  ;; Standard Stuff
  (default
   :foreground ,(mango-theme--color 'foreground)
   :background ,(mango-theme--color 'background))
  (fringe
   :inherit default)

  ;; Lines
  (hl-line
   :background ,(mango-theme--color 'background-faint))
  (region
   :background ,(mango-theme--color 'middleground))
  (header-line
   :background ,(mango-theme--color 'middleground))
  (mode-line-active
   :inherit header-line)
  (mode-line-inactive
   :background ,(mango-theme--color 'background-cool)
   :weight light)
  (window-divider
   :foreground ,(mango-theme--color 'background-cool))
  (window-divider-first-pixel
   :foreground ,(mango-theme--color 'background-cool))
  (window-divider-last-pixel
   :foreground ,(mango-theme--color 'background-cool))

  ;; Line Numbers
  (line-number
   :foreground ,(mango-theme--color 'background-faint)
   :background ,(mango-theme--color 'background))
  (line-number-current-line
   :foreground ,(mango-theme--color 'orange)
   :background ,(mango-theme--color 'background)
   :weight bold)

  ;; Documentation
  (font-lock-comment-face
   :foreground ,(mango-theme--color 'disabled))
  (font-lock-doc-face
   :inherit font-lock-comment-face)

  ;; Modeline
  (mm-modeline-readonly-face
   :weight bold)
  (mm-modeline-buffer-name-face
   :inherit font-lock-constant-face)
  (mm-modeline-buffer-modified-face
   :inherit shadow)
  (mm-modeline-major-mode-name-face
   :weight bold)
  (mm-modeline-major-mode-symbol-face
   :inherit shadow)
  (mm-modeline-narrow-face
   :background ,(mango-theme--color 'dark-red)
   :box ,(mango-theme--color 'dark-red)
   :weight bold)
  (mm-modeline-git-branch-face
   :inherit font-lock-constant-face)

  ;; Core Language
  (font-lock-keyword-face
   :foreground ,(mango-theme--color 'violet))
  (font-lock-type-face
   :foreground ,(mango-theme--color 'celestial-blue))
  (font-lock-builtin-face
   :inherit font-lock-preprocessor-face)

  ;; Function-likes
  (font-lock-function-name-face
   :foreground ,(mango-theme--color 'khaki))
  (font-lock-preprocessor-face
   :foreground ,(mango-theme--color 'pink)
   :weight bold)

  ;; Variables
  (font-lock-variable-name-face
   :foreground ,(mango-theme--color 'pale-azure))
  (font-lock-constant-face
   :inherit font-lock-variable-name-face
   :weight bold)

  ;; Other literals
  (font-lock-number-face
   :foreground ,(mango-theme--color 'orange))
  (help-key-binding
   :inherit font-lock-constant-face)

  ;; Org Mode
  (org-code
   :foreground ,(mango-theme--color 'orange))
  (org-verbatim
   :foreground ,(mango-theme--color 'lime))
  (org-block
   :background ,(mango-theme--color 'background-cool))
  (org-hide
   :foreground ,(mango-theme--color 'background))
  (org-quote
   :inherit org-block
   :slant italic)

  ;; Info Page
  (Info-quoted
   :inherit default)

  ;; Magit
  (magit-diff-hunk-heading
   :background ,(mango-theme--color 'background-cool))
  (magit-diff-hunk-heading-highlight
   :background ,(mango-theme--color 'middleground))
  (magit-diff-context-highlight
   :inherit hl-line)
  (magit-section-highlight
   :inherit hl-line)

  (git-commit-summary
   :foreground ,(mango-theme--color 'khaki))
  (git-commit-overlong-summary
   :foreground ,(mango-theme--color 'foreground)
   :background ,(mango-theme--color 'spanish-red)
   :weight bold)

  ;; Vertico
  (vertico-current
   :inherit hl-line)

  ;; Marginalia
  (marginalia-documentation
   :foreground ,(mango-theme--color 'disabled)
   :underline nil)

  ;; Tempel
  (tempel-default
   :slant italic
   :background ,(mango-theme--color 'middleground))
  (tempel-field
   :slant italic
   :background ,(mango-theme--color 'middleground))
  (tempel-form
   :slant italic
   :background ,(mango-theme--color 'middleground)))