allow darker/lighter LineNr background

This commit is contained in:
Michael Chris Lopez
2021-10-20 16:25:48 +08:00
parent 11adf7eb4d
commit b2898b692b
4 changed files with 33 additions and 21 deletions

View File

@@ -45,6 +45,14 @@ Change background colors darkness. Options: `'stark'`, `'warm'`.
Default: `v:false`. Make vertical split more distinguishable background
highlight.
#### g:zenbones_darken_linenr
Default: `v:false`. Darken LineNr background.
#### g:zenflesh_lighten_linenr
Default: `v:false`. Lighten LineNr background.
#### g:zenbones_dim_noncurrent_window
Default: `v:false`. Make non-current window background dimmer than _Normal_.
@@ -61,13 +69,13 @@ Default: `v:true`. Make comments italicize.
#### g:zenbones_darken_comments
Default: 38. Percentage to darken comments. Comments base their fg color on the
bg palette. See also |lush-color-darken|.
Default: 38. Percentage to darken comments. Comments base their foreground color
on the bg palette. See also |lush-color-darken|.
#### g:zenflesh_lighten_comments
Default: 38. Percentage to lighten comments. Comments base their fg color on the
bg palette. See also |lush-color-lighten|.
Default: 38. Percentage to lighten comments. Comments base their foreground
color on the bg palette. See also |lush-color-lighten|.
#### g:zenbones_compat

View File

@@ -12,8 +12,9 @@ local function generate(p, opt)
vim.notify(error_msg, vim.log.levels.WARN)
end
local lighten_comment = opt.lighten_comment or 38
local lighten_comments = opt.lighten_comments or 38
local comment_gui = opt.comment_gui or "italic"
local lighten_linenr = opt.lighten_linenr
-- stylua: ignore start
local theme = lush(function()
@@ -40,7 +41,7 @@ local function generate(p, opt)
ErrorMsg { Error }, -- error messages on the command line
WarningMsg { fg = p.wood }, -- warning messages
Comment { fg = p.bg.li(lighten_comment).de(24), gui = comment_gui }, -- any comment
Comment { fg = p.bg.li(lighten_comments).de(24), gui = comment_gui }, -- any comment
Conceal { fg = p.fg.da(20), gui = "bold,italic" }, -- placeholder characters substituted for concealed text (see 'conceallevel')
Cursor { bg = p.fg.li(20), fg = p.bg.da(20) }, -- character under the cursor
@@ -58,7 +59,7 @@ local function generate(p, opt)
DiffDelete { bg = p.rose.saturation(30).lightness(normal_bg.l + 8) }, -- diff mode: Deleted line |diff.txt|
DiffText { bg = p.water.saturation(50).lightness(normal_bg.l + 20), fg = p.fg }, -- diff mode: Changed text within a changed line |diff.txt|
LineNr { fg = Normal.bg.li(30) }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
LineNr { fg = Normal.bg.li(30), bg = lighten_linenr and Normal.bg.li(6) or "NONE" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
SignColumn { LineNr }, -- column where |signs| are displayed
FoldColumn { LineNr, gui = "bold" }, -- 'foldcolumn'
Folded { bg = Normal.bg.li(16), fg = Normal.bg.li(64) }, -- line used for closed folds
@@ -92,7 +93,7 @@ local function generate(p, opt)
TabLine { StatusLine }, -- tab pages line, not active tab page label
TabLineFill { StatusLineNC }, -- tab pages line, where there are no labels
TabLineSel { gui = "bold" }, -- tab pages line, active tab page label
VertSplit { LineNr }, -- the column separating vertically split windows
VertSplit { fg = LineNr.fg }, -- the column separating vertically split windows
Visual { bg = p.fg.de(18).da(68) }, -- Visual mode selection
-- VisualNOS { }, -- Visual mode selection when vim is "Not Owning the Selection".
@@ -292,9 +293,9 @@ local function generate(p, opt)
helpOption { Constant },
-- Other plugins
GitSignsAdd { fg = p.leaf },
GitSignsChange { fg = p.water },
GitSignsDelete { fg = p.rose },
GitSignsAdd { SignColumn, fg = p.leaf },
GitSignsChange { SignColumn, fg = p.water },
GitSignsDelete { SignColumn, fg = p.rose },
GitGutterAdd { GitSignsAdd },
GitGutterChange { GitSignsChange },

View File

@@ -9,13 +9,15 @@ function M.get_global_config(prefix, base_bg)
return vim.tbl_extend("keep", {
lightness = vim.g[prefix .. "_lightness"],
dim_noncurrent_window = vim.g[prefix .. "_dim_noncurrent_window"],
darken_comment = vim.g[prefix .. "_darken_comment"],
darken_comments = vim.g[prefix .. "_darken_comments"],
darken_linenr = vim.g[prefix .. "_darken_linenr"],
}, common)
else
return vim.tbl_extend("keep", {
darkness = vim.g[prefix .. "_darkness"],
lighten_noncurrent_window = vim.g[prefix .. "_lighten_noncurrent_window"],
lighten_comment = vim.g[prefix .. "_lighten_comment"],
lighten_comments = vim.g[prefix .. "_lighten_comments"],
lighten_linenr = vim.g[prefix .. "_lighten_linenr"],
}, common)
end
end

View File

@@ -12,8 +12,9 @@ local function generate(p, opt)
vim.notify(error_msg, vim.log.levels.WARN)
end
local darken_comment = opt.darken_comment or 38
local darken_comments = opt.darken_comments or 38
local comment_gui = opt.comment_gui or "italic"
local darken_linenr = opt.darken_linenr
-- stylua: ignore start
local theme = lush(function()
@@ -40,7 +41,7 @@ local function generate(p, opt)
ErrorMsg { Error }, -- error messages on the command line
WarningMsg { fg = p.wood }, -- warning messages
Comment { fg = p.bg.da(darken_comment).de(28), gui = comment_gui }, -- any comment
Comment { fg = p.bg.da(darken_comments).de(28), gui = comment_gui }, -- any comment
Conceal { fg = p.fg.li(20), gui = "bold,italic" }, -- placeholder characters substituted for concealed text (see 'conceallevel')
Cursor { bg = p.fg, fg = p.bg.li(20) }, -- character under the cursor
@@ -49,7 +50,7 @@ local function generate(p, opt)
TermCursor { Cursor }, -- cursor in a focused terminal
TermCursorNC { lCursor }, -- cursor in an unfocused terminal
CursorLine { bg = Normal.bg.da(4) }, -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set.
CursorLine { bg = Normal.bg.da(3) }, -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set.
CursorColumn { CursorLine }, -- Screen-column at the cursor, when 'cursorcolumn' is set.
ColorColumn { bg = p.wood.de(38).li(80) }, -- used for the columns set with 'colorcolumn'
@@ -58,7 +59,7 @@ local function generate(p, opt)
DiffDelete { bg = p.rose.saturation(40).lightness(normal_bg.l - 6) }, -- diff mode: Deleted line |diff.txt|
DiffText { bg = p.water.saturation(30).lightness(normal_bg.l - 18), fg = p.fg }, -- diff mode: Changed text within a changed line |diff.txt|
LineNr { fg = Normal.bg.da(32) }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
LineNr { fg = Normal.bg.da(32), bg = darken_linenr and Normal.bg.da(4) or "NONE" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
SignColumn { LineNr }, -- column where |signs| are displayed
FoldColumn { LineNr, gui = "bold" }, -- 'foldcolumn'
Folded { bg = Normal.bg.da(16), fg = Normal.bg.da(64) }, -- line used for closed folds
@@ -92,7 +93,7 @@ local function generate(p, opt)
TabLine { StatusLine }, -- tab pages line, not active tab page label
TabLineFill { StatusLineNC }, -- tab pages line, where there are no labels
TabLineSel { gui = "bold" }, -- tab pages line, active tab page label
VertSplit { LineNr }, -- the column separating vertically split windows
VertSplit { fg = LineNr.fg }, -- the column separating vertically split windows
Visual { bg = p.fg.li(84) }, -- Visual mode selection
-- VisualNOS { }, -- Visual mode selection when vim is "Not Owning the Selection".
@@ -292,9 +293,9 @@ local function generate(p, opt)
helpOption { Constant },
-- Other plugins
GitSignsAdd { fg = p.leaf },
GitSignsChange { fg = p.water },
GitSignsDelete { fg = p.rose },
GitSignsAdd { SignColumn, fg = p.leaf },
GitSignsChange { SignColumn, fg = p.water },
GitSignsDelete { SignColumn, fg = p.rose },
GitGutterAdd { GitSignsAdd },
GitGutterChange { GitSignsChange },