Skip to content

Commit

Permalink
breaking-change: Major Changes and Deprecation of some colorschemes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ful1e5 committed Apr 23, 2023
1 parent 0b9d4d0 commit 1a96bd0
Show file tree
Hide file tree
Showing 39 changed files with 1,422 additions and 1,990 deletions.
51 changes: 33 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,32 +123,46 @@ require('github-theme').setup({
hide_end_of_buffer = true,
hide_nc_statusline = true,
styles = {
comments = 'Italic',
comments = 'italic,bold',
functions = 'NONE',
keywords = 'Bold',
variables = 'Underline',
keywords = 'bold',
variables = 'underline',
},
darken = {
floats = true,
sidebars = {
enable = true,
list = { 'qf', 'vista_kind', 'terminal', 'packer' },
list = {},
},
},
},

-- Change the "hint" color to the "orange" color, and make the "error" color bright red
colors = { hint = 'orange', error = '#ff0000' },
specs = {
-- Change the color of only the 'github_dark' theme's 'hint' color to magenta and make the 'error' color a dim red.
github_dark = {
diag = {
error = '#660000',
hint = 'magenta.base',
},
},
-- Change the "hint" color to the "orange" color, and make the "error" color bright red.
all = {
diag = {
error = '#ff0000',
hint = 'orange',
},
},
},

-- Overwrite the highlight groups
overrides = function(c)
return {
htmlTag = { fg = c.red, bg = '#282c34', sp = c.hint, style = 'underline' },
-- Overwrite the highlight groups for all colorschemes
groups = {
all = {
htmlTag = { fg = 'palette.red', bg = '#282c34', sp = 'diag.hint', style = 'underline,bold' },
DiagnosticHint = { link = 'LspDiagnosticsDefaultHint' },
-- this will remove the highlight groups
TSField = {},
}
end,
},
},
})

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

## Features
Expand Down Expand Up @@ -352,10 +367,10 @@ require("github-theme").setup({
require("github-theme").setup({
options = {
styles = {
comments = "Italic",
functions = "Italic",
keywords = "Italic",
variables = "Italic"
comments = "italic",
functions = "italic",
keywords = "italic",
variables = "italic"
}
},
-- ...
Expand Down
1 change: 1 addition & 0 deletions colors/github_dark.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ lua << EOF

require("github-theme.config").set_theme('github_dark')
require("github-theme").load()

EOF
1 change: 1 addition & 0 deletions colors/github_dark_colorblind.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ lua << EOF

require("github-theme.config").set_theme('github_dark_colorblind')
require("github-theme").load()

EOF
17 changes: 15 additions & 2 deletions colors/github_dark_default.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
lua << EOF

require("github-theme.config").set_theme('github_dark_default')
require("github-theme").load()
local dep = require('github-theme.lib.deprecation')
dep.write(
' Colorscheme ',
{ 'github_dark_default', 'WarningMsg' },
' has been deprecated.',
' Use ',
{ 'github_dark_high_contrast', 'WarningMsg' },
' Instead. Refer to ',
{ ':h github-theme.changelog-23042023', 'WarningMsg' },
' for more info.'
)

require('github-theme.config').set_theme('github_dark_high_contrast')
require('github-theme').load()

EOF
6 changes: 6 additions & 0 deletions colors/github_dark_dimmed.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lua << EOF

require('github-theme.config').set_theme('github_dark_dimmed')
require('github-theme').load()

EOF
6 changes: 6 additions & 0 deletions colors/github_dark_high_contrast.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lua << EOF

require('github-theme.config').set_theme('github_dark_high_contrast')
require('github-theme').load()

EOF
6 changes: 6 additions & 0 deletions colors/github_dark_tritanopia.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lua << EOF

require('github-theme.config').set_theme('github_dark_tritanopia')
require('github-theme').load()

EOF
17 changes: 15 additions & 2 deletions colors/github_dimmed.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
lua << EOF

require("github-theme.config").set_theme('github_dimmed')
require("github-theme").load()
local dep = require('github-theme.lib.deprecation')
dep.write(
' Colorscheme ',
{ 'github_dimmed', 'WarningMsg' },
' has been deprecated.',
' Use ',
{ 'github_dark_dimmed', 'WarningMsg' },
' Instead. Refer to ',
{ ':h github-theme.changelog-23042023', 'WarningMsg' },
' for more info.'
)

require('github-theme.config').set_theme('github_dark_dimmed')
require('github-theme').load()

EOF
1 change: 1 addition & 0 deletions colors/github_light.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ lua << EOF

require("github-theme.config").set_theme('github_light')
require("github-theme").load()

EOF
1 change: 1 addition & 0 deletions colors/github_light_colorblind.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ lua << EOF

require("github-theme.config").set_theme('github_light_colorblind')
require("github-theme").load()

EOF
17 changes: 15 additions & 2 deletions colors/github_light_default.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
lua << EOF

require("github-theme.config").set_theme('github_light_default')
require("github-theme").load()
local dep = require('github-theme.lib.deprecation')
dep.write(
' Colorscheme ',
{ 'github_light_default', 'WarningMsg' },
' has been deprecated.',
' Use ',
{ 'github_light_high_contrast', 'WarningMsg' },
' Instead. Refer to ',
{ ':h github-theme.changelog-23042023', 'WarningMsg' },
' for more info.'
)

require('github-theme.config').set_theme('github_light_high_contrast')
require('github-theme').load()

EOF
6 changes: 6 additions & 0 deletions colors/github_light_high_contrast.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lua << EOF

require('github-theme.config').set_theme('github_light_high_contrast')
require('github-theme').load()

EOF
6 changes: 6 additions & 0 deletions colors/github_light_tritanopia.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lua << EOF

require('github-theme.config').set_theme('github_light_tritanopia')
require('github-theme').load()

EOF
79 changes: 73 additions & 6 deletions doc/gt_changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,85 @@

# Changelog

*github-theme.changelog-23042023*
Date: April 23, 2023

The way to override color variables has been updated. You can now use the
|specs| table to change colors for a specific colorscheme or for all of them
with the |all| table. To override highlight groups, use the |groups| table in
the configuration.

Some changes have been made to the names of the colorschemes. You can check
the names of the colorschemes in the "colors" directory in the project root,
or by using the *:colorscheme* vim command.

The deprecated colorschemes will no longer support any overriding highlight
groups or color variables. The updated colorscheme list:

- |github_dark_default| -> |github_dark_high_contrast|
- |github_dimmed| -> |github_dark_dimmed|
- |github_light_default| -> |github_light_high_contrast|
- |github_dark_tritanopia| -> New!
- |github_light_tritanopia| -> New!

The updated configuration keys are:
- |colors| -> Use |specs| and |palettes| instead.
- |overrides| -> Use |groups| instead.

Example:
>
require('github-theme').setup({
--- ...
palettes = {
github_dark = {
canvas = {
default = '#000000',
},
},
all = {
danger = {
fg = '#FF0000',
},
},
},
specs = {
github_dark_dimmed = {
bg0 = '#111111',
},
all = {
diag = {
error = '#FF0000',
},
},
},
groups = {
github_dark = {
Error = { fg = '#FF0000' },
},
all = {
ErrorMsg = { link = 'Error' },
},
},
})
vim.cmd.colorscheme('github_dark_colorblind')
<



*github-theme.changelog-13042023*
Date: April 13, 2023

The configuration for defining transparency, darkening windows, floating, and hiding elements has been moved to the *options* table.
The configuration for defining transparency, darkening windows, floating, and
hiding elements has been moved to the *options* table.

The updated configuration keys are as follows:
- |transparent| -> |options.transparent|
- |hide_end_of_buffer| -> |options.hide_end_of_buffer|
- |transparent| -> |options.transparent|
- |hide_end_of_buffer| -> |options.hide_end_of_buffer|
- |hide_inactive_statusline| -> |options.hide_nc_statusline|
- |dark_float| -> |options.darken.floats|
- |dark_sidebar|-> |options.darken.sidebars.enable|
- |sidebars|-> |options.darken.sidebars.list|
- |dark_float| -> |options.darken.floats|
- |dark_sidebar| -> |options.darken.sidebars.enable|
- |sidebars| -> |options.darken.sidebars.list|



Expand Down
21 changes: 18 additions & 3 deletions doc/gt_deprecated.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ They should not be used in new scripts, and old scripts should be updated.
==============================================================================
Deprecated features

COLORSCHEMES

- *'github_dimmed'* Deprecated. Use |'github_dark_dimmed'| Instead.
- *'github_dark_default'* Deprecated. Use |'github_dark_high_contrast'| Instead.
- *'github_light_default'* Deprecated. Use |'github_light_high_contrast'| Instead.


SETUP OPTIONS
- *'theme_style'* Removed. Use 'colorscheme'
command to set colorscheme. Refer `':h github-theme.changelog-11042023'`
Expand All @@ -24,6 +31,8 @@ SETUP OPTIONS
- *'dark_float'* Deprecated. Use |'options.darken.floats'| Instead.
- *'dark_sidebar'* Deprecated. Use |'options.darken.sidebars.enable'| Instead.
- *'sidebars'* Deprecated. Use |'options.darken.sidebars.list'| Instead.
- *'colors'* Deprecated. Use |'specs'| and |'palettes'| Instead.
- *'overrides'* Deprecated. Use |'groups'| Instead.


GLOBAL OPTIONS
Expand Down Expand Up @@ -60,9 +69,15 @@ MODULES
module and accessed with |'default'| variable.

FUNCTIONS
- *'config.apply_configuration()'* Removed.
- *'util.load()'* Use |require('github-theme').load()|
function instead.

*'github-theme.util'*
- *'load()'* Use |require('github-theme').load()| function instead.

*'github-theme.config'*
- *'apply_configuration()'* Removed.

*'github-theme.palette'*
- *'setup()'* Use |load()| function instead.



Expand Down
4 changes: 2 additions & 2 deletions lua/github-theme/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ local defaults = {
hide_end_of_buffer = true,
hide_nc_statusline = true,
styles = {
comments = 'Italic',
comments = 'italic',
functions = 'NONE',
keywords = 'Italic',
keywords = 'italic',
variables = 'NONE',

-- conditionals = 'NONE',
Expand Down
Loading

0 comments on commit 1a96bd0

Please sign in to comment.