configurable NonText contrast

This commit is contained in:
Michael Chris Lopez
2021-10-26 17:10:17 +08:00
parent 7b85e5327d
commit 3fc8d324fc
4 changed files with 18 additions and 6 deletions

View File

@@ -76,13 +76,23 @@ Default: `v:true`. Make comments italicize.
#### g:zenbones_darken_comments #### g:zenbones_darken_comments
Default: 38. Percentage to darken comments. Comments base their foreground color Default: 38. Percentage to darken comments relative to Normal bg. See also
on the bg palette. See also |lush-color-darken|. |lush-color-darken|.
#### g:zenflesh_lighten_comments #### g:zenflesh_lighten_comments
Default: 38. Percentage to lighten comments. Comments base their foreground Default: 38. Percentage to lighten comments relative to Normal bg. See also
color on the bg palette. See also |lush-color-lighten|. |lush-color-lighten|.
#### g:zenbones_darken_non_text
Default: 22. Percentage to darken |hl-NonText| relative to Normal bg. See also
|lush-color-darken|.
#### g:zenflesh_lighten_none_text
Default: 26. Percentage to lighten |hl-NonText| relative to Normal bg. See also
|lush-color-darken|.
#### g:zenbones_compat #### g:zenbones_compat

View File

@@ -102,7 +102,7 @@ local function generate(p, opt)
Visual { bg = p.fg.de(18).lightness(Normal.bg.l + 18) }, -- Visual mode selection Visual { bg = p.fg.de(18).lightness(Normal.bg.l + 18) }, -- Visual mode selection
-- VisualNOS { }, -- Visual mode selection when vim is "Not Owning the Selection". -- VisualNOS { }, -- Visual mode selection when vim is "Not Owning the Selection".
NonText { fg = Normal.bg.li(26) }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|. NonText { fg = Normal.bg.li(opt.lighten_non_text or 26) }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
SpecialKey { NonText, gui = "italic" }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace| SpecialKey { NonText, gui = "italic" }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
Whitespace { NonText }, -- "nbsp", "space", "tab" and "trail" in 'listchars' Whitespace { NonText }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
EndOfBuffer { NonText }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|. EndOfBuffer { NonText }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.

View File

@@ -19,6 +19,7 @@ function M.get_global_config(prefix, base_bg)
darken_noncurrent_window = vim.g[prefix .. "_darken_noncurrent_window"], darken_noncurrent_window = vim.g[prefix .. "_darken_noncurrent_window"],
darken_comments = vim.g[prefix .. "_darken_comments"], darken_comments = vim.g[prefix .. "_darken_comments"],
darken_line_nr = vim.g[prefix .. "_darken_line_nr"], darken_line_nr = vim.g[prefix .. "_darken_line_nr"],
darken_non_text = vim.g[prefix .. "_darken_non_text"],
}, common) }, common)
else else
return vim.tbl_extend("keep", { return vim.tbl_extend("keep", {
@@ -26,6 +27,7 @@ function M.get_global_config(prefix, base_bg)
lighten_noncurrent_window = vim.g[prefix .. "_lighten_noncurrent_window"], lighten_noncurrent_window = vim.g[prefix .. "_lighten_noncurrent_window"],
lighten_comments = vim.g[prefix .. "_lighten_comments"], lighten_comments = vim.g[prefix .. "_lighten_comments"],
lighten_line_nr = vim.g[prefix .. "_lighten_line_nr"], lighten_line_nr = vim.g[prefix .. "_lighten_line_nr"],
lighten_non_text = vim.g[prefix .. "_lighten_non_text"],
}, common) }, common)
end end
end end

View File

@@ -102,7 +102,7 @@ local function generate(p, opt)
Visual { bg = p.fg.lightness(Normal.bg.l - 8) }, -- Visual mode selection Visual { bg = p.fg.lightness(Normal.bg.l - 8) }, -- Visual mode selection
-- VisualNOS { }, -- Visual mode selection when vim is "Not Owning the Selection". -- VisualNOS { }, -- Visual mode selection when vim is "Not Owning the Selection".
NonText { fg = Normal.bg.da(22) }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|. NonText { fg = Normal.bg.da(opt.darken_non_text or 22) }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
SpecialKey { NonText, gui = "italic" }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace| SpecialKey { NonText, gui = "italic" }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
Whitespace { NonText }, -- "nbsp", "space", "tab" and "trail" in 'listchars' Whitespace { NonText }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
EndOfBuffer { NonText }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|. EndOfBuffer { NonText }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.