Skip to content

Commit addf54f

Browse files
committed
windows-terminal-theme: generate using lua script
1 parent e954639 commit addf54f

18 files changed

+205
-167
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
- terminal-theme: Xresources theme added #166
2222
- chore: unlink 'Visual' highlight from plugin highlights
2323
- kitty: add cursor foreground color ( fixed #174 )
24+
- terminal-theme: Windows Terminal theme added #180 @mutecipher
2425

2526
### Fixes
2627

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- Minimal inactive statusline (only work with **Vim's Default StatusLine**)
1414
- Vim terminal colors
1515
- Darker background for sidebar-like windows
16-
- Color configs for [kitty](https://sw.kovidgoyal.net/kitty/conf.html?highlight=include), [iTerm2](https://iterm2.com/), [Konsole](https://konsole.kde.org/), [tmux](https://github.com/tmux/tmux/wiki), [Xresources](https://wiki.archlinux.org/title/x_resources) and [Alacritty](https://github.com/alacritty/alacritty)
16+
- Color configs for [kitty](https://sw.kovidgoyal.net/kitty/conf.html?highlight=include), [iTerm2](https://iterm2.com/), [Konsole](https://konsole.kde.org/), [tmux](https://github.com/tmux/tmux/wiki), [Xresources](https://wiki.archlinux.org/title/x_resources), [Windows Terminal](https://github.com/microsoft/terminal) and [Alacritty](https://github.com/alacritty/alacritty)
1717
- Most elegant [**lualine** theme](./LUALINE.md#screenshots)
1818

1919
## Requirements
@@ -124,12 +124,13 @@ Installation docs and screenshots at [LUALINE.md](./LUALINE.md).
124124
125125
Extra color configs for **kitty**, **iTerm**, **Konsole**, **tmux**, **Xresources** and **Alacritty** can be found in [terminal](terminal/) directory. To use them, refer to their respective documentation.
126126

127-
- kitty - [./terminal/kitty](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/kitty)
128-
- iTerm - [./terminal/iterm](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/iterm)
129-
- Konsole - [./terminal/konsole](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/konsole)
130-
- tmux - [./terminal/tmux](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/tmux)
131127
- Alacritty - [./terminal/alacritty](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/alacritty)
128+
- Konsole - [./terminal/konsole](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/konsole)
129+
- Windows Terminal - [./terminal/windows_terminal](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/windows_terminal)
132130
- Xresources - [./terminal/xresources](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/xresources)
131+
- iTerm - [./terminal/iterm](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/iterm)
132+
- kitty - [./terminal/kitty](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/kitty)
133+
- tmux - [./terminal/tmux](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/tmux)
133134

134135
### Making `undercurls` work properly in **Tmux**
135136

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
local palette = require('github-theme.palette')
2+
local util = require('github-theme.util')
3+
4+
---Generate github theme for windows terminal.
5+
---@param cfg gt.ConfigSchema
6+
return function(cfg)
7+
local colors = palette.get_palette(cfg.theme_style)
8+
9+
local name = 'Github ' .. cfg.theme_style:lower():gsub('^%l', string.upper)
10+
local windows_terminal = util.template([[
11+
{
12+
"name": "]] .. name .. [[",
13+
"background": "${bg}",
14+
"foreground": "${fg_term}",
15+
"cursorColor": "${cursor}",
16+
"selectionBackground": "${bg_visual_selection}",
17+
"black": "${black}",
18+
"brightBlack": "${bright_black}",
19+
"white": "${white}",
20+
"brightWhite": "${bright_white}",
21+
"red": "${red}",
22+
"brightRed": "${bright_red}",
23+
"green": "${green}",
24+
"brightGreen": "${bright_green}",
25+
"yellow": "${yellow}",
26+
"brightYellow": "${bright_yellow}",
27+
"blue": "${blue}",
28+
"brightBlue": "${bright_blue}",
29+
"purple": "${magenta}",
30+
"brightPurple": "${bright_magenta}",
31+
"cyan": "${cyan}",
32+
"brightCyan": "${bright_cyan}"
33+
}]], colors)
34+
return windows_terminal
35+
end

lua/github-theme/types/gt.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ gt.HighlightStyle.Stanout = 'stanout'
2323
gt.HighlightStyle.NoCombine = 'nocombine'
2424
gt.HighlightStyle.Strikethrough = 'strikethrough'
2525

26-
---@alias gt.TerminalConf "'conf'" | "'yml'" | "'itermcolors'" | "'colorscheme'" | "'tmux'" | "'xresources'"
26+
---@alias gt.TerminalConf "'conf'" | "'yml'" | "'itermcolors'" | "'colorscheme'" | "'tmux'" | "'xresources'" | "windows_terminal"
2727
gt.TerminalConf = {}
2828
gt.TerminalConf.kitty = 'conf'
2929
gt.TerminalConf.alacritty = 'yml'
3030
gt.TerminalConf.iterm = 'itermcolors'
3131
gt.TerminalConf.konsole = 'colorscheme'
3232
gt.TerminalConf.tmux = 'conf'
3333
gt.TerminalConf.xresources = 'Xresources'
34+
gt.TerminalConf.windows_terminal = 'json'
3435

3536
---@class gt.Highlight
3637
---Foreground Color

terminal/windows-terminal/github_dark.json

-23
This file was deleted.

terminal/windows-terminal/github_dark_colorblind.json

-23
This file was deleted.

terminal/windows-terminal/github_dark_default.json

-23
This file was deleted.

terminal/windows-terminal/github_dimmed.json

-23
This file was deleted.

terminal/windows-terminal/github_light.json

-23
This file was deleted.

terminal/windows-terminal/github_light_colorblind.json

-23
This file was deleted.

terminal/windows-terminal/github_light_default.json

-23
This file was deleted.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "Github Dark",
3+
"background": "#24292e",
4+
"foreground": "#d1d5da",
5+
"cursorColor": "#c8e1ff",
6+
"selectionBackground": "#284566",
7+
"black": "#586069",
8+
"brightBlack": "#959da5",
9+
"white": "#d1d5da",
10+
"brightWhite": "#fafbfc",
11+
"red": "#ea4a5a",
12+
"brightRed": "#f97583",
13+
"green": "#34d058",
14+
"brightGreen": "#85e89d",
15+
"yellow": "#ffea7f",
16+
"brightYellow": "#ffea7f",
17+
"blue": "#2188ff",
18+
"brightBlue": "#79b8ff",
19+
"purple": "#b392f0",
20+
"brightPurple": "#b392f0",
21+
"cyan": "#39c5cf",
22+
"brightCyan": "#56d4dd"
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "Github Dark_colorblind",
3+
"background": "#0d1117",
4+
"foreground": "#b3b1ad",
5+
"cursorColor": "#73b7f2",
6+
"selectionBackground": "#163356",
7+
"black": "#484f58",
8+
"brightBlack": "#6e7681",
9+
"white": "#b1bac4",
10+
"brightWhite": "#f0f6fc",
11+
"red": "#ff7b72",
12+
"brightRed": "#ffa198",
13+
"green": "#3fb950",
14+
"brightGreen": "#56d364",
15+
"yellow": "#d29922",
16+
"brightYellow": "#e3b341",
17+
"blue": "#58a6ff",
18+
"brightBlue": "#79c0ff",
19+
"purple": "#bc8cff",
20+
"brightPurple": "#d2a8ff",
21+
"cyan": "#39c5cf",
22+
"brightCyan": "#56d4dd"
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "Github Dark_default",
3+
"background": "#0d1117",
4+
"foreground": "#b3b1ad",
5+
"cursorColor": "#73b7f2",
6+
"selectionBackground": "#163356",
7+
"black": "#484f58",
8+
"brightBlack": "#6e7681",
9+
"white": "#b1bac4",
10+
"brightWhite": "#f0f6fc",
11+
"red": "#ff7b72",
12+
"brightRed": "#ffa198",
13+
"green": "#3fb950",
14+
"brightGreen": "#56d364",
15+
"yellow": "#d29922",
16+
"brightYellow": "#e3b341",
17+
"blue": "#58a6ff",
18+
"brightBlue": "#79c0ff",
19+
"purple": "#bc8cff",
20+
"brightPurple": "#d2a8ff",
21+
"cyan": "#39c5cf",
22+
"brightCyan": "#56d4dd"
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "Github Dimmed",
3+
"background": "#22272e",
4+
"foreground": "#768390",
5+
"cursorColor": "#6cb6ff",
6+
"selectionBackground": "#264466",
7+
"black": "#545d68",
8+
"brightBlack": "#636e7b",
9+
"white": "#909dab",
10+
"brightWhite": "#cdd9e5",
11+
"red": "#f47067",
12+
"brightRed": "#ff938a",
13+
"green": "#57ab5a",
14+
"brightGreen": "#6bc46d",
15+
"yellow": "#c69026",
16+
"brightYellow": "#daaa3f",
17+
"blue": "#539bf5",
18+
"brightBlue": "#6cb6ff",
19+
"purple": "#b083f0",
20+
"brightPurple": "#dcbdfb",
21+
"cyan": "#39c5cf",
22+
"brightCyan": "#56d4dd"
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "Github Light",
3+
"background": "#ffffff",
4+
"foreground": "#24292f",
5+
"cursorColor": "#044289",
6+
"selectionBackground": "#dbe9f9",
7+
"black": "#24292e",
8+
"brightBlack": "#959da5",
9+
"white": "#6a737d",
10+
"brightWhite": "#d1d5da",
11+
"red": "#d73a49",
12+
"brightRed": "#cb2431",
13+
"green": "#28a745",
14+
"brightGreen": "#22863a",
15+
"yellow": "#dbab09",
16+
"brightYellow": "#b08800",
17+
"blue": "#0366d6",
18+
"brightBlue": "#005cc5",
19+
"purple": "#5a32a3",
20+
"brightPurple": "#5a32a3",
21+
"cyan": "#0598bc",
22+
"brightCyan": "#3192aa"
23+
}

0 commit comments

Comments
 (0)