Add light/dark background handling to main form
This commit is contained in:
parent
3c0f206029
commit
2c9281be0d
|
@ -59,8 +59,6 @@ lua << EOF
|
||||||
|
|
||||||
-- This is the name of your colorscheme which will be used as per |g:colors_name|.
|
-- This is the name of your colorscheme which will be used as per |g:colors_name|.
|
||||||
vim.g.colors_name = 'highlite'
|
vim.g.colors_name = 'highlite'
|
||||||
-- This is the kind of colorscheme you are creating. Either 'light' or 'dark'
|
|
||||||
vim.o.background = 'dark'
|
|
||||||
|
|
||||||
--[[ Step 3: Colors
|
--[[ Step 3: Colors
|
||||||
Next you will define all of the colors that you will use for the color scheme.
|
Next you will define all of the colors that you will use for the color scheme.
|
||||||
|
@ -124,10 +122,11 @@ local purple_light = {'#af60af', 63, 'magenta'}
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
<highlight group name> = {
|
<highlight group name> = {
|
||||||
bg=<color>, -- The color used for background color, or use `NONE`, `FG` or `BG`
|
bg=<color>, -- The color for the background, `NONE`, `FG` or `BG`
|
||||||
fg=<color>, -- The color used for foreground color, or use `NONE`, `FG` or `BG`
|
fg=<color>, -- The color for the foreground, `NONE`, `FG` or `BG`
|
||||||
blend=<integer> -- The |highlight-blend| value, if one is desired.
|
blend=<integer> -- The |highlight-blend| value, if one is desired.
|
||||||
-- Style can be 'bold', 'italic', and more. See |attr-list| for more information. It can also have a color, and/or multiple <cterm>s.
|
-- Style can be 'bold', 'italic', and more. See |attr-list| for more information.
|
||||||
|
-- It can also have a color, and/or multiple <cterm>s.
|
||||||
style=<cterm>|{<cterm> [, <cterm>] [color=<color>]})
|
style=<cterm>|{<cterm> [, <cterm>] [color=<color>]})
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -137,8 +136,10 @@ local purple_light = {'#af60af', 63, 'magenta'}
|
||||||
```lua
|
```lua
|
||||||
<highlight group name> = '<highlight group name>'
|
<highlight group name> = '<highlight group name>'
|
||||||
```
|
```
|
||||||
|
____________________________________________________________________________
|
||||||
|
|
||||||
Here is an example to define `SpellBad` and then link some new group `SpellWorse` to it:
|
Here is an example to define `SpellBad` and then link some new group
|
||||||
|
`SpellWorse` to it:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
SpellBad = { -- ← name of the highlight group
|
SpellBad = { -- ← name of the highlight group
|
||||||
|
@ -157,7 +158,7 @@ local purple_light = {'#af60af', 63, 'magenta'}
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
SpellBad = { -- ← name of the highlight group
|
SpellBad = { -- ← name of the highlight group
|
||||||
bg='NONE', -- background color
|
bg=NONE, -- background color
|
||||||
fg=red, -- foureground color
|
fg=red, -- foureground color
|
||||||
style={ -- the style
|
style={ -- the style
|
||||||
'undercurl', -- undercurl (squiggly line)
|
'undercurl', -- undercurl (squiggly line)
|
||||||
|
@ -166,20 +167,39 @@ local purple_light = {'#af60af', 63, 'magenta'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
____________________________________________________________________________
|
||||||
|
|
||||||
You can add any custom highlight group to the standard list below but you shouldn't
|
If you want to create a colorscheme that is responsive to the user's
|
||||||
remove any if you want a working colorscheme. Most of them are described under
|
'background' setting, you can specify special `light` and `dark` keys to
|
||||||
|highlight-default|, some from |group-name|, and others from common syntax groups.
|
define how each group should be highlighted in each case.
|
||||||
Both help sections are good reads.
|
|
||||||
|
```lua
|
||||||
|
SpellBad = {
|
||||||
|
bg=NONE,
|
||||||
|
dark={fg=white},
|
||||||
|
light={fg=black},
|
||||||
|
style={'undercurl', color=red}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Whenever the user changes their 'background' setting, the settings inside of
|
||||||
|
whichever key is relevant will be loaded.
|
||||||
|
____________________________________________________________________________
|
||||||
|
|
||||||
|
You can add any custom highlight group to the standard list below but you
|
||||||
|
shouldn't remove any if you want a working colorscheme. Most of them are
|
||||||
|
described under |highlight-default|, some from |group-name|, and others from
|
||||||
|
common syntax groups. Both help sections are good reads.
|
||||||
|
|
||||||
NOTE: |Replace-mode| will probably be useful here.
|
NOTE: |Replace-mode| will probably be useful here.
|
||||||
|
|
||||||
NOTE: /As long as you do not remove any highlight groups or colors/, you can safely
|
NOTE: /As long as you do not remove any highlight groups or colors/, you can
|
||||||
ignore any highlight groups that are `link`ed to others.
|
safely ignore any highlight groups that are `link`ed to others.
|
||||||
|
|
||||||
For example, programming languages almost exclusively link to the 1st
|
For example, programming languages almost exclusively link to the 1st
|
||||||
and 2nd sections, so as long as you define everything there you will automatically
|
and 2nd sections, so as long as you define everything there you will
|
||||||
be defining the rest of the highlights, which is one of the benefits of using
|
automatically be defining the rest of the highlights, which is one of
|
||||||
this template.
|
the benefits of using this template.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
--[[ DO NOT EDIT `BG`, `FG`, or `NONE`.
|
--[[ DO NOT EDIT `BG`, `FG`, or `NONE`.
|
||||||
|
|
Loading…
Reference in New Issue