aboutsummaryrefslogtreecommitdiff
path: root/emacs.tera
blob: 1a65f82bb414cb3bf9c455cf12a3ce191bdd40a5 (plain)
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
---
whiskers:
  version: ^2.0.0
  matrix:
    - flavor
  filename: "emacs/evergarden-{{flavor.identifier}}-theme.el"
---
{# Copyright (C) 2026 Magdalena Szweda #}
{#
 SPDX-License-Identifier: Apache-2.0

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
#}
{%- set is_dark = flavor.dark | default(value=true) -%}
{%- set c = flavor.colors -%}

{%- set red_warmer = c.red | add(hue=0) | sub(hue=9) | add(saturation=2) | sub(lightness=1) -%}
{%- set red_cooler = c.red | add(hue=14, saturation=2) | sub(lightness=2) -%}
{%- set red_faint_s = (c.red.hsl.s * 0.6 * 100) | round | int -%}
{%- if is_dark -%}
  {%- set red_faint = c.red | mod(saturation=red_faint_s) | sub(lightness=10) -%}
{%- else -%}
  {%- set red_faint = c.red | mod(saturation=red_faint_s) | add(lightness=10) -%}
{%- endif -%}

{%- set green_warmer = c.lime -%}
{%- set green_cooler_pre = c.green | add(hue=16) -%}
{%- set green_cooler = if(cond=is_dark, t=green_cooler_pre | sub(lightness=1), f=green_cooler_pre | add(lightness=1)) -%}
{%- set green_faint_s = (c.green.hsl.s * 0.65 * 100) | round | int -%}
{%- if is_dark -%}
  {%- set green_faint = c.green | mod(saturation=green_faint_s) | sub(lightness=10) -%}
{%- else -%}
  {%- set green_faint = c.green | mod(saturation=green_faint_s) | add(lightness=10) -%}
{%- endif -%}

{%- set yellow_warmer = c.yellow | sub(hue=8) | add(saturation=2) -%}
{%- set yellow_cooler_pre = c.yellow | add(hue=10) -%}
{%- set yellow_cooler_s = (c.yellow.hsl.s * 100 - 5) | round | int -%}
{%- set yellow_cooler_pre2 = c.yellow | add(hue=10) | mod(saturation=yellow_cooler_s) -%}
{%- set yellow_cooler = if(cond=is_dark, t=yellow_cooler_pre2 | sub(lightness=1), f=yellow_cooler_pre2 | add(lightness=1)) -%}
{%- set yellow_faint_s = (c.yellow.hsl.s * 0.6 * 100) | round | int -%}
{%- if is_dark -%}
  {%- set yellow_faint = c.yellow | mod(saturation=yellow_faint_s) | sub(lightness=10) -%}
{%- else -%}
  {%- set yellow_faint = c.yellow | mod(saturation=yellow_faint_s) | add(lightness=10) -%}
{%- endif -%}

{%- set blue_warmer = c.snow -%}
{%- set blue_cooler_pre = c.blue | add(hue=14) -%}
{%- set blue_cooler = if(cond=is_dark, t=blue_cooler_pre | sub(lightness=1), f=blue_cooler_pre | add(lightness=1)) -%}
{%- set blue_faint_s = (c.blue.hsl.s * 0.6 * 100) | round | int -%}
{%- if is_dark -%}
  {%- set blue_faint = c.blue | mod(saturation=blue_faint_s) | sub(lightness=11) -%}
{%- else -%}
  {%- set blue_faint = c.blue | mod(saturation=blue_faint_s) | add(lightness=11) -%}
{%- endif -%}

{%- set magenta = c.purple -%}
{%- set magenta_warmer = c.pink -%}
{%- set magenta_cooler_pre = c.purple | add(hue=14) -%}
{%- set magenta_cooler = if(cond=is_dark, t=magenta_cooler_pre | sub(lightness=1), f=magenta_cooler_pre | add(lightness=1)) -%}
{%- set magenta_faint_s = (c.purple.hsl.s * 0.6 * 100) | round | int -%}
{%- if is_dark -%}
  {%- set magenta_faint = c.purple | mod(saturation=magenta_faint_s) | sub(lightness=11) -%}
{%- else -%}
  {%- set magenta_faint = c.purple | mod(saturation=magenta_faint_s) | add(lightness=11) -%}
{%- endif -%}

{%- set cyan = c.aqua -%}
{%- set cyan_warmer = c.aqua | sub(hue=14) -%}
{%- set cyan_cooler = c.skye -%}
{%- set cyan_faint_s = (c.aqua.hsl.s * 0.65 * 100) | round | int -%}
{%- if is_dark -%}
  {%- set cyan_faint = c.aqua | mod(saturation=cyan_faint_s) | sub(lightness=11) -%}
{%- else -%}
  {%- set cyan_faint = c.aqua | mod(saturation=cyan_faint_s) | add(lightness=11) -%}
{%- endif -%}

{%- if is_dark -%}
  {%- set int_s = 42 %}{% set int_l = 30 -%}
  {%- set sub_s = 26 %}{% set sub_l = 23 -%}
  {%- set nua_s = 16 %}{% set nua_l = 19 -%}
  {%- set g0_s = 55 %}{% set g0_l = 42 -%}
  {%- set g1_s = 40 %}{% set g1_l = 30 -%}
{%- else -%}
  {%- set int_s = 50 %}{% set int_l = 84 -%}
  {%- set sub_s = 40 %}{% set sub_l = 90 -%}
  {%- set nua_s = 35 %}{% set nua_l = 92 -%}
  {%- set g0_s = 35 %}{% set g0_l = 60 -%}
  {%- set g1_s = 35 %}{% set g1_l = 75 -%}
{%- endif -%}

{%- set bg_red_intense = c.red | mod(saturation=int_s, lightness=int_l) -%}
{%- set bg_red_subtle = c.red | mod(saturation=sub_s, lightness=sub_l) -%}
{%- set bg_red_nuanced = c.red | mod(saturation=nua_s, lightness=nua_l) -%}
{%- set bg_graph_red_0 = c.red | mod(saturation=g0_s, lightness=g0_l) -%}
{%- set bg_graph_red_1 = c.red | mod(saturation=g1_s, lightness=g1_l) -%}

{%- set bg_green_intense = c.green | mod(saturation=int_s, lightness=int_l) -%}
{%- set bg_green_subtle = c.green | mod(saturation=sub_s, lightness=sub_l) -%}
{%- set bg_green_nuanced = c.green | mod(saturation=nua_s, lightness=nua_l) -%}
{%- set bg_graph_green_0 = c.green | mod(saturation=g0_s, lightness=g0_l) -%}
{%- set bg_graph_green_1 = c.green | mod(saturation=g1_s, lightness=g1_l) -%}

{%- set bg_yellow_intense = c.yellow | mod(saturation=int_s, lightness=int_l) -%}
{%- set bg_yellow_subtle = c.yellow | mod(saturation=sub_s, lightness=sub_l) -%}
{%- set bg_yellow_nuanced = c.yellow | mod(saturation=nua_s, lightness=nua_l) -%}
{%- set bg_graph_yellow_0 = c.yellow | mod(saturation=g0_s, lightness=g0_l) -%}
{%- set bg_graph_yellow_1 = c.yellow | mod(saturation=g1_s, lightness=g1_l) -%}

{%- set bg_blue_intense = c.blue | mod(saturation=int_s, lightness=int_l) -%}
{%- set bg_blue_subtle = c.blue | mod(saturation=sub_s, lightness=sub_l) -%}
{%- set bg_blue_nuanced = c.blue | mod(saturation=nua_s, lightness=nua_l) -%}
{%- set bg_graph_blue_0 = c.blue | mod(saturation=g0_s, lightness=g0_l) -%}
{%- set bg_graph_blue_1 = c.blue | mod(saturation=g1_s, lightness=g1_l) -%}

{%- set bg_magenta_intense = c.purple | mod(saturation=int_s, lightness=int_l) -%}
{%- set bg_magenta_subtle = c.purple | mod(saturation=sub_s, lightness=sub_l) -%}
{%- set bg_magenta_nuanced = c.purple | mod(saturation=nua_s, lightness=nua_l) -%}
{%- set bg_graph_magenta_0 = c.purple | mod(saturation=g0_s, lightness=g0_l) -%}
{%- set bg_graph_magenta_1 = c.purple | mod(saturation=g1_s, lightness=g1_l) -%}

{%- set bg_cyan_intense = c.aqua | mod(saturation=int_s, lightness=int_l) -%}
{%- set bg_cyan_subtle = c.aqua | mod(saturation=sub_s, lightness=sub_l) -%}
{%- set bg_cyan_nuanced = c.aqua | mod(saturation=nua_s, lightness=nua_l) -%}
{%- set bg_graph_cyan_0 = c.aqua | mod(saturation=g0_s, lightness=g0_l) -%}
{%- set bg_graph_cyan_1 = c.aqua | mod(saturation=g1_s, lightness=g1_l) -%}

{%- set intense_txt_s = if(cond=is_dark, t=10, f=8) -%}
{%- set intense_txt_l = if(cond=is_dark, t=25, f=15) -%}
{%- set fg_added_intense = c.green | add(saturation=intense_txt_s) | sub(lightness=intense_txt_l) -%}
{%- set fg_changed_intense = yellow_cooler | add(saturation=intense_txt_s) | sub(lightness=intense_txt_l) -%}
{%- set fg_removed_intense = c.red | add(saturation=intense_txt_s) | sub(lightness=intense_txt_l) -%}

;;; evergarden-{{flavor.identifier}}-theme.el --- Evergarden, {{flavor.name}} flavor -*- lexical-binding: t; -*-

;; Copyright (C) 2026 Magdalena Szweda
;; Color palette Copyright (C) <me@koi.rip, https://robinwobin.dev>
;; Author: Magdalena Szweda <hi@roughlynamed.net>
;; Version: 0.2.0
;; Package-Requires: ((emacs "28.1") (modus-themes "5.0.0") (ef-themes "2.0.0"))
;; Keywords: faces, theme

;; SPDX-License-Identifier: Apache-2.0

;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;;     http://www.apache.org/licenses/LICENSE-2.0
;;
;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

;;; Commentary:
;; {{flavor.name}} flavor of Evergarden fer Emacs, based on the
;; Evergarden theme by June <me@koi.rip> & Robin <https://robinwobin.dev> (https://codeberg.org/evergarden)


;;; Code:

(unless (featurep 'evergarden-common)
  (let ((common (locate-file "evergarden-common"
                              (append (seq-filter #'stringp custom-theme-load-path)
                                      load-path)
                              '(".el" ".elc" ""))))
    (if common
        (load common)
      (error "evergarden-common.el not found; add its directory to `custom-theme-load-path'"))))

(defconst evergarden-{{flavor.identifier}}-palette-partial
  '(
    ;; Core backgrounds / foregrounds
    (cursor "#{{c.cherry | hex}}")
    (bg-main "#{{c.base | hex}}")
    (bg-dim "#{{c.surface0 | hex}}")
    (bg-alt "#{{c.surface1 | hex}}")
    (fg-main "#{{c.text | hex}}")
    (fg-dim "#{{c.subtext1 | hex}}")
    (fg-alt "#{{c.subtext0 | hex}}")
    (bg-active "#{{c.surface2 | hex}}")
    (bg-inactive "#{{c.surface0 | hex}}")
    (border "#{{c.overlay0 | hex}}")

    ;; {{flavor.name}}'s own named palette (from the whiskers color table)
    (bg-hl "#{{c.surface2 | hex}}")
    (bg-prose-block "#{{ if(cond=is_dark, t=c.base | add(lightness=3) | hex, f=c.base | sub(lightness=2) | hex) }}")
{%- for id, color in c %}
    ({{id}} "#{{color.hex}}")
{%- endfor %}

    ;; Red family
    (red-warmer "#{{red_warmer | hex}}")
    (red-cooler "#{{red_cooler | hex}}")
    (red-faint "#{{red_faint | hex}}")

    ;; Green family
    (green-warmer "#{{green_warmer | hex}}")
    (green-cooler "#{{green_cooler | hex}}")
    (green-faint "#{{green_faint | hex}}")

    ;; Yellow family
    (yellow-warmer "#{{yellow_warmer | hex}}")
    (yellow-cooler "#{{yellow_cooler | hex}}")
    (yellow-faint "#{{yellow_faint | hex}}")

    ;; Blue family
    (blue-warmer "#{{blue_warmer | hex}}")
    (blue-cooler "#{{blue_cooler | hex}}")
    (blue-faint "#{{blue_faint | hex}}")

    ;; Magenta/purple family
    (magenta "#{{magenta | hex}}")
    (magenta-warmer "#{{magenta_warmer | hex}}")
    (magenta-cooler "#{{magenta_cooler | hex}}")
    (magenta-faint "#{{magenta_faint | hex}}")

    ;; Cyan family
    (cyan "#{{cyan | hex}}")
    (cyan-warmer "#{{cyan_warmer | hex}}")
    (cyan-cooler "#{{cyan_cooler | hex}}")
    (cyan-faint "#{{cyan_faint | hex}}")

    ;; Intense/Subtle/Nuanced backgrounds
    (bg-red-intense "#{{bg_red_intense | hex}}")
    (bg-red-subtle "#{{bg_red_subtle | hex}}")
    (bg-red-nuanced "#{{bg_red_nuanced | hex}}")
    (bg-green-intense "#{{bg_green_intense | hex}}")
    (bg-green-subtle "#{{bg_green_subtle | hex}}")
    (bg-green-nuanced "#{{bg_green_nuanced | hex}}")
    (bg-yellow-intense "#{{bg_yellow_intense | hex}}")
    (bg-yellow-subtle "#{{bg_yellow_subtle | hex}}")
    (bg-yellow-nuanced "#{{bg_yellow_nuanced | hex}}")
    (bg-blue-intense "#{{bg_blue_intense | hex}}")
    (bg-blue-subtle "#{{bg_blue_subtle | hex}}")
    (bg-blue-nuanced "#{{bg_blue_nuanced | hex}}")
    (bg-magenta-intense "#{{bg_magenta_intense | hex}}")
    (bg-magenta-subtle "#{{bg_magenta_subtle | hex}}")
    (bg-magenta-nuanced "#{{bg_magenta_nuanced | hex}}")
    (bg-cyan-intense "#{{bg_cyan_intense | hex}}")
    (bg-cyan-subtle "#{{bg_cyan_subtle | hex}}")
    (bg-cyan-nuanced "#{{bg_cyan_nuanced | hex}}")

    ;; Graph colors
    (bg-graph-red-0 "#{{bg_graph_red_0 | hex}}")
    (bg-graph-red-1 "#{{bg_graph_red_1 | hex}}")
    (bg-graph-green-0 "#{{bg_graph_green_0 | hex}}")
    (bg-graph-green-1 "#{{bg_graph_green_1 | hex}}")
    (bg-graph-yellow-0 "#{{bg_graph_yellow_0 | hex}}")
    (bg-graph-yellow-1 "#{{bg_graph_yellow_1 | hex}}")
    (bg-graph-blue-0 "#{{bg_graph_blue_0 | hex}}")
    (bg-graph-blue-1 "#{{bg_graph_blue_1 | hex}}")
    (bg-graph-magenta-0 "#{{bg_graph_magenta_0 | hex}}")
    (bg-graph-magenta-1 "#{{bg_graph_magenta_1 | hex}}")
    (bg-graph-cyan-0 "#{{bg_graph_cyan_0 | hex}}")
    (bg-graph-cyan-1 "#{{bg_graph_cyan_1 | hex}}")

    ;; Diff
    (bg-added "#{{bg_green_intense | hex}}")
    (bg-added-faint "#{{bg_green_subtle | hex}}")
    (bg-added-refine "#{{bg_green_intense | mix(color=bg_green_subtle, amount=0.4) | hex}}")
    (bg-added-fringe "#{{bg_graph_green_0 | hex}}")
    (fg-added "#{{c.green | hex}}")
    (fg-added-intense "#{{fg_added_intense | hex}}")

    (bg-changed "#{{bg_yellow_intense | hex}}")
    (bg-changed-faint "#{{bg_yellow_subtle | hex}}")
    (bg-changed-refine "#{{bg_yellow_intense | mix(color=bg_yellow_subtle, amount=0.4) | hex}}")
    (bg-changed-fringe "#{{bg_graph_yellow_0 | hex}}")
    (fg-changed "#{{yellow_cooler | hex}}")
    (fg-changed-intense "#{{fg_changed_intense | hex}}")

    (bg-removed "#{{bg_red_intense | hex}}")
    (bg-removed-faint "#{{bg_red_subtle | hex}}")
    (bg-removed-refine "#{{bg_red_intense | mix(color=bg_red_subtle, amount=0.4) | hex}}")
    (bg-removed-fringe "#{{bg_graph_red_0 | hex}}")
    (fg-removed "#{{c.red | hex}}")
    (fg-removed-intense "#{{fg_removed_intense | hex}}")

    (bg-diff-context "#{{c.surface2 | hex}}")

    ;; UI chrome
    (bg-mode-line-active "#{{c.surface2 | sub(lightness=3) | hex}}")
    (fg-mode-line-active "#{{c.text | hex}}")
    (bg-mode-line-inactive "#{{c.surface0 | hex}}")
    (fg-mode-line-inactive "#{{c.subtext1 | hex}}")
    (border-mode-line-active "#{{c.green | hex}}")
    (border-mode-line-inactive "#{{c.overlay0 | hex}}")
    (bg-completion "#{{c.surface0 | hex}}")
    (bg-hover "#{{c.surface2 | hex}}")
    (bg-hover-secondary "#{{bg_blue_subtle | hex}}")
    (bg-hl-line "#{{c.surface0 | hex}}")
    (bg-paren-match "#{{c.orange | hex}}")
    (bg-err "#{{bg_red_intense | hex}}")
    (bg-warning "#{{bg_yellow_intense | hex}}")
    (bg-info "#{{bg_cyan_intense | hex}}")
    (bg-region "#{{c.surface1 | hex}}"))
  "Base palette entries for `evergarden-{{flavor.identifier}}', generated by whiskers.")

(evergarden-build-theme 'evergarden-{{flavor.identifier}} evergarden-{{flavor.identifier}}-palette-partial '{{ if(cond=is_dark, t="dark", f="light") }})

(provide 'evergarden-{{flavor.identifier}}-theme)

;;; evergarden-{{flavor.identifier}}-theme.el ends here