[colorschemes] add a generator for the VSCode terminal

This commit is contained in:
Dmytro Meleshko 2020-10-04 19:27:16 +03:00
parent 0e1f13cc7b
commit 6f4b85af33
3 changed files with 60 additions and 2 deletions

View File

@ -9,7 +9,7 @@ MAKEFLAGS += --no-builtin-rules
.PHONY: all clean
OUT_DIR := out
OUT_FILES := iterm.itermcolors kitty.conf vim.vim setvtrgb.txt zsh.zsh termux.properties variables.css prismjs-theme.css
OUT_FILES := iterm.itermcolors kitty.conf vim.vim setvtrgb.txt zsh.zsh termux.properties variables.css prismjs-theme.css vscode-colorCustomizations.json
all: $(OUT_DIR) $(addprefix $(OUT_DIR)/,$(OUT_FILES))
@ -20,6 +20,6 @@ out:
mkdir -p $@
$(OUT_DIR)/%: %.py _theme.py
./$< > $@
python3 ./$< > $@
$(OUT_DIR)/prismjs-theme.css: prismjs-theme-src.css

View File

@ -0,0 +1,23 @@
{
"terminal.background": "#2d2d2d",
"terminal.foreground": "#d3d0c8",
"terminal.selectionBackground": "#515151",
"terminalCursor.background": "#2d2d2d",
"terminalCursor.foreground": "#d3d0c8",
"terminal.ansiBlack": "#2d2d2d",
"terminal.ansiRed": "#f2777a",
"terminal.ansiGreen": "#99cc99",
"terminal.ansiYellow": "#ffcc66",
"terminal.ansiBlue": "#6699cc",
"terminal.ansiMagenta": "#cc99cc",
"terminal.ansiCyan": "#66cccc",
"terminal.ansiWhite": "#d3d0c8",
"terminal.ansiBrightBlack": "#747369",
"terminal.ansiBrightRed": "#f2777a",
"terminal.ansiBrightGreen": "#99cc99",
"terminal.ansiBrightYellow": "#ffcc66",
"terminal.ansiBrightBlue": "#6699cc",
"terminal.ansiBrightMagenta": "#cc99cc",
"terminal.ansiBrightCyan": "#66cccc",
"terminal.ansiBrightWhite": "#f2f0ec"
}

View File

@ -0,0 +1,35 @@
#!/usr/bin/env python3
import _theme as theme
import json
ANSI_COLOR_NAMES = [
"Black",
"Red",
"Green",
"Yellow",
"Blue",
"Magenta",
"Cyan",
"White",
]
colors = {
"terminal.background": theme.bg,
"terminal.foreground": theme.fg,
"terminal.selectionBackground": theme.selection_bg,
"terminalCursor.background": theme.cursor_fg,
"terminalCursor.foreground": theme.cursor_bg,
}
for color_brightness in [False, True]:
for color_index, color_name in enumerate(ANSI_COLOR_NAMES):
color = theme.ansi_colors[
color_index + int(color_brightness) * len(ANSI_COLOR_NAMES)
]
colors[
"terminal.ansi" + ("Bright" if color_brightness else "") + color_name
] = color
print(json.dumps(colors, ensure_ascii=False, indent=2))