-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-repl-version
executable file
·42 lines (32 loc) · 1.17 KB
/
generate-repl-version
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
#!/usr/bin/env python3
# This script generates a version of the colour scheme intended for use in REPLs running
# inside Sublime Text (e.g. Tutkain's)
import json
from pathlib import Path
import json5
SCHEME_PATH = Path("Humid.sublime-color-scheme")
REPL_SCHEME_PATH = Path("Humid for REPL.sublime-color-scheme")
with open(SCHEME_PATH) as infile:
scheme = json5.load(infile)
scheme["name"] = f"{REPL_SCHEME_PATH.stem} (GENERATED FILE - DO NOT EDIT DIRECTLY)"
scheme["variables"].update(
{
"blue_slate": "color(var(slate) blend(var(blue) 85%) lightness(- 5%))",
"--redish": "var(red_punchy)",
}
)
scheme["globals"]["background"] = "var(blue_slate)"
scheme["globals"]["gutter"] = "var(blue_slate)"
scheme["rules"].extend(
[
{
"scope": "source.clojure.repl tutkain.repl.stderr",
"background": "var(black)",
# NOTE: Tutkain already colours the corresponding chevron icon in the gutter
# using `redish`, so use the exact same variable to guarantee they match.
"foreground": "var(--redish)",
},
]
)
with open(REPL_SCHEME_PATH, "w") as outfile:
json.dump(scheme, outfile, indent=2)