Skip to content

Commit 1a96bd0

Browse files
committed
breaking-change: Major Changes and Deprecation of some colorschemes
In this commit, I redefined the older highlight groups and removed support for all plugins listed in the README, including Lualine (which I redefined in the next commits). Furthermore, all the previous color palettes have been replaced with Primer. The configurations `overrides` and `colors` are now deprecated. Please use `palettes` and `specs` for color overriding as requested in feature request #176, and use `groups` for overriding the highlight groups. For more information, please refer to `:h github-theme.changelog-23042023`. Additionally, the example has been updated in the README.
1 parent 0b9d4d0 commit 1a96bd0

39 files changed

+1422
-1990
lines changed

README.md

+33-18
Original file line numberDiff line numberDiff line change
@@ -123,32 +123,46 @@ require('github-theme').setup({
123123
hide_end_of_buffer = true,
124124
hide_nc_statusline = true,
125125
styles = {
126-
comments = 'Italic',
126+
comments = 'italic,bold',
127127
functions = 'NONE',
128-
keywords = 'Bold',
129-
variables = 'Underline',
128+
keywords = 'bold',
129+
variables = 'underline',
130130
},
131131
darken = {
132132
floats = true,
133133
sidebars = {
134134
enable = true,
135-
list = { 'qf', 'vista_kind', 'terminal', 'packer' },
135+
list = {},
136136
},
137137
},
138138
},
139139

140-
-- Change the "hint" color to the "orange" color, and make the "error" color bright red
141-
colors = { hint = 'orange', error = '#ff0000' },
140+
specs = {
141+
-- Change the color of only the 'github_dark' theme's 'hint' color to magenta and make the 'error' color a dim red.
142+
github_dark = {
143+
diag = {
144+
error = '#660000',
145+
hint = 'magenta.base',
146+
},
147+
},
148+
-- Change the "hint" color to the "orange" color, and make the "error" color bright red.
149+
all = {
150+
diag = {
151+
error = '#ff0000',
152+
hint = 'orange',
153+
},
154+
},
155+
},
142156

143-
-- Overwrite the highlight groups
144-
overrides = function(c)
145-
return {
146-
htmlTag = { fg = c.red, bg = '#282c34', sp = c.hint, style = 'underline' },
157+
-- Overwrite the highlight groups for all colorschemes
158+
groups = {
159+
all = {
160+
htmlTag = { fg = 'palette.red', bg = '#282c34', sp = 'diag.hint', style = 'underline,bold' },
147161
DiagnosticHint = { link = 'LspDiagnosticsDefaultHint' },
148162
-- this will remove the highlight groups
149163
TSField = {},
150-
}
151-
end,
164+
},
165+
},
152166
})
153167

154168
vim.cmd('colorscheme github_dark')
@@ -166,8 +180,9 @@ vim.cmd('colorscheme github_dark')
166180
| options.darken.floats | `false` | Float windows like the lsp diagnostics windows get a darker background. |
167181
| options.darken.sidebars.enable | `true` | Sidebar like windows like `NvimTree` get a darker background |
168182
| options.darken.sidebars.list | `{}` | Set a darker background on sidebar-like windows. For example: `{"qf", "vista_kind", "terminal", "packer"}` |
169-
| colors | `{}` | You can override specific color groups to use other groups or a hex color |
170-
| overrides | `function` | Override specific highlight groups. The function accpet colors as argument. You can also add a non-exists highlight by enabling the `dev` mode. |
183+
| palettes | `{}` | You can override specific color groups to use other groups or a hex color |
184+
| specs | `{}` | You can override specific spec color groups to use other groups or a hex color |
185+
| groups | `{}` | Override specific highlight groups. The function accpet colors as argument. You can also add a non-exists highlight by enabling the `dev` mode. |
171186
| dev | `false` | Developer Mode. |
172187

173188
## Features
@@ -352,10 +367,10 @@ require("github-theme").setup({
352367
require("github-theme").setup({
353368
options = {
354369
styles = {
355-
comments = "Italic",
356-
functions = "Italic",
357-
keywords = "Italic",
358-
variables = "Italic"
370+
comments = "italic",
371+
functions = "italic",
372+
keywords = "italic",
373+
variables = "italic"
359374
}
360375
},
361376
-- ...

colors/github_dark.vim

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ lua << EOF
22

33
require("github-theme.config").set_theme('github_dark')
44
require("github-theme").load()
5+
56
EOF

colors/github_dark_colorblind.vim

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ lua << EOF
22

33
require("github-theme.config").set_theme('github_dark_colorblind')
44
require("github-theme").load()
5+
56
EOF

colors/github_dark_default.vim

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
lua << EOF
22

3-
require("github-theme.config").set_theme('github_dark_default')
4-
require("github-theme").load()
3+
local dep = require('github-theme.lib.deprecation')
4+
dep.write(
5+
' Colorscheme ',
6+
{ 'github_dark_default', 'WarningMsg' },
7+
' has been deprecated.',
8+
' Use ',
9+
{ 'github_dark_high_contrast', 'WarningMsg' },
10+
' Instead. Refer to ',
11+
{ ':h github-theme.changelog-23042023', 'WarningMsg' },
12+
' for more info.'
13+
)
14+
15+
require('github-theme.config').set_theme('github_dark_high_contrast')
16+
require('github-theme').load()
17+
518
EOF

colors/github_dark_dimmed.vim

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lua << EOF
2+
3+
require('github-theme.config').set_theme('github_dark_dimmed')
4+
require('github-theme').load()
5+
6+
EOF

colors/github_dark_high_contrast.vim

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lua << EOF
2+
3+
require('github-theme.config').set_theme('github_dark_high_contrast')
4+
require('github-theme').load()
5+
6+
EOF

colors/github_dark_tritanopia.vim

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lua << EOF
2+
3+
require('github-theme.config').set_theme('github_dark_tritanopia')
4+
require('github-theme').load()
5+
6+
EOF

colors/github_dimmed.vim

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
lua << EOF
22

3-
require("github-theme.config").set_theme('github_dimmed')
4-
require("github-theme").load()
3+
local dep = require('github-theme.lib.deprecation')
4+
dep.write(
5+
' Colorscheme ',
6+
{ 'github_dimmed', 'WarningMsg' },
7+
' has been deprecated.',
8+
' Use ',
9+
{ 'github_dark_dimmed', 'WarningMsg' },
10+
' Instead. Refer to ',
11+
{ ':h github-theme.changelog-23042023', 'WarningMsg' },
12+
' for more info.'
13+
)
14+
15+
require('github-theme.config').set_theme('github_dark_dimmed')
16+
require('github-theme').load()
17+
518
EOF

colors/github_light.vim

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ lua << EOF
22

33
require("github-theme.config").set_theme('github_light')
44
require("github-theme").load()
5+
56
EOF

colors/github_light_colorblind.vim

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ lua << EOF
22

33
require("github-theme.config").set_theme('github_light_colorblind')
44
require("github-theme").load()
5+
56
EOF

colors/github_light_default.vim

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
lua << EOF
22

3-
require("github-theme.config").set_theme('github_light_default')
4-
require("github-theme").load()
3+
local dep = require('github-theme.lib.deprecation')
4+
dep.write(
5+
' Colorscheme ',
6+
{ 'github_light_default', 'WarningMsg' },
7+
' has been deprecated.',
8+
' Use ',
9+
{ 'github_light_high_contrast', 'WarningMsg' },
10+
' Instead. Refer to ',
11+
{ ':h github-theme.changelog-23042023', 'WarningMsg' },
12+
' for more info.'
13+
)
14+
15+
require('github-theme.config').set_theme('github_light_high_contrast')
16+
require('github-theme').load()
17+
518
EOF

colors/github_light_high_contrast.vim

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lua << EOF
2+
3+
require('github-theme.config').set_theme('github_light_high_contrast')
4+
require('github-theme').load()
5+
6+
EOF

colors/github_light_tritanopia.vim

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lua << EOF
2+
3+
require('github-theme.config').set_theme('github_light_tritanopia')
4+
require('github-theme').load()
5+
6+
EOF

doc/gt_changelog.txt

+73-6
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,85 @@
33

44
# Changelog
55

6+
*github-theme.changelog-23042023*
7+
Date: April 23, 2023
8+
9+
The way to override color variables has been updated. You can now use the
10+
|specs| table to change colors for a specific colorscheme or for all of them
11+
with the |all| table. To override highlight groups, use the |groups| table in
12+
the configuration.
13+
14+
Some changes have been made to the names of the colorschemes. You can check
15+
the names of the colorschemes in the "colors" directory in the project root,
16+
or by using the *:colorscheme* vim command.
17+
18+
The deprecated colorschemes will no longer support any overriding highlight
19+
groups or color variables. The updated colorscheme list:
20+
21+
- |github_dark_default| -> |github_dark_high_contrast|
22+
- |github_dimmed| -> |github_dark_dimmed|
23+
- |github_light_default| -> |github_light_high_contrast|
24+
- |github_dark_tritanopia| -> New!
25+
- |github_light_tritanopia| -> New!
26+
27+
The updated configuration keys are:
28+
- |colors| -> Use |specs| and |palettes| instead.
29+
- |overrides| -> Use |groups| instead.
30+
31+
Example:
32+
>
33+
require('github-theme').setup({
34+
--- ...
35+
palettes = {
36+
github_dark = {
37+
canvas = {
38+
default = '#000000',
39+
},
40+
},
41+
all = {
42+
danger = {
43+
fg = '#FF0000',
44+
},
45+
},
46+
},
47+
specs = {
48+
github_dark_dimmed = {
49+
bg0 = '#111111',
50+
},
51+
all = {
52+
diag = {
53+
error = '#FF0000',
54+
},
55+
},
56+
},
57+
groups = {
58+
github_dark = {
59+
Error = { fg = '#FF0000' },
60+
},
61+
all = {
62+
ErrorMsg = { link = 'Error' },
63+
},
64+
},
65+
})
66+
67+
vim.cmd.colorscheme('github_dark_colorblind')
68+
<
69+
70+
71+
672
*github-theme.changelog-13042023*
773
Date: April 13, 2023
874

9-
The configuration for defining transparency, darkening windows, floating, and hiding elements has been moved to the *options* table.
75+
The configuration for defining transparency, darkening windows, floating, and
76+
hiding elements has been moved to the *options* table.
1077

1178
The updated configuration keys are as follows:
12-
- |transparent| -> |options.transparent|
13-
- |hide_end_of_buffer| -> |options.hide_end_of_buffer|
79+
- |transparent| -> |options.transparent|
80+
- |hide_end_of_buffer| -> |options.hide_end_of_buffer|
1481
- |hide_inactive_statusline| -> |options.hide_nc_statusline|
15-
- |dark_float| -> |options.darken.floats|
16-
- |dark_sidebar|-> |options.darken.sidebars.enable|
17-
- |sidebars|-> |options.darken.sidebars.list|
82+
- |dark_float| -> |options.darken.floats|
83+
- |dark_sidebar| -> |options.darken.sidebars.enable|
84+
- |sidebars| -> |options.darken.sidebars.list|
1885

1986

2087

doc/gt_deprecated.txt

+18-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ They should not be used in new scripts, and old scripts should be updated.
1010
==============================================================================
1111
Deprecated features
1212

13+
COLORSCHEMES
14+
15+
- *'github_dimmed'* Deprecated. Use |'github_dark_dimmed'| Instead.
16+
- *'github_dark_default'* Deprecated. Use |'github_dark_high_contrast'| Instead.
17+
- *'github_light_default'* Deprecated. Use |'github_light_high_contrast'| Instead.
18+
19+
1320
SETUP OPTIONS
1421
- *'theme_style'* Removed. Use 'colorscheme'
1522
command to set colorscheme. Refer `':h github-theme.changelog-11042023'`
@@ -24,6 +31,8 @@ SETUP OPTIONS
2431
- *'dark_float'* Deprecated. Use |'options.darken.floats'| Instead.
2532
- *'dark_sidebar'* Deprecated. Use |'options.darken.sidebars.enable'| Instead.
2633
- *'sidebars'* Deprecated. Use |'options.darken.sidebars.list'| Instead.
34+
- *'colors'* Deprecated. Use |'specs'| and |'palettes'| Instead.
35+
- *'overrides'* Deprecated. Use |'groups'| Instead.
2736

2837

2938
GLOBAL OPTIONS
@@ -60,9 +69,15 @@ MODULES
6069
module and accessed with |'default'| variable.
6170

6271
FUNCTIONS
63-
- *'config.apply_configuration()'* Removed.
64-
- *'util.load()'* Use |require('github-theme').load()|
65-
function instead.
72+
73+
*'github-theme.util'*
74+
- *'load()'* Use |require('github-theme').load()| function instead.
75+
76+
*'github-theme.config'*
77+
- *'apply_configuration()'* Removed.
78+
79+
*'github-theme.palette'*
80+
- *'setup()'* Use |load()| function instead.
6681

6782

6883

lua/github-theme/config.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ local defaults = {
77
hide_end_of_buffer = true,
88
hide_nc_statusline = true,
99
styles = {
10-
comments = 'Italic',
10+
comments = 'italic',
1111
functions = 'NONE',
12-
keywords = 'Italic',
12+
keywords = 'italic',
1313
variables = 'NONE',
1414

1515
-- conditionals = 'NONE',

0 commit comments

Comments
 (0)