From 3fc8d324fcb8956a3b827ad9d7401f9d1a648b9d Mon Sep 17 00:00:00 2001 From: Michael Chris Lopez Date: Tue, 26 Oct 2021 17:10:17 +0800 Subject: [PATCH] configurable NonText contrast --- doc/zenbones.md | 18 ++++++++++++++---- lua/zenbones/specs/dark.lua | 2 +- lua/zenbones/specs/init.lua | 2 ++ lua/zenbones/specs/light.lua | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/zenbones.md b/doc/zenbones.md index 0941a89..1af7717 100644 --- a/doc/zenbones.md +++ b/doc/zenbones.md @@ -76,13 +76,23 @@ Default: `v:true`. Make comments italicize. #### g:zenbones_darken_comments -Default: 38. Percentage to darken comments. Comments base their foreground color -on the bg palette. See also |lush-color-darken|. +Default: 38. Percentage to darken comments relative to Normal bg. See also +|lush-color-darken|. #### g:zenflesh_lighten_comments -Default: 38. Percentage to lighten comments. Comments base their foreground -color on the bg palette. See also |lush-color-lighten|. +Default: 38. Percentage to lighten comments relative to Normal bg. See also +|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 diff --git a/lua/zenbones/specs/dark.lua b/lua/zenbones/specs/dark.lua index 0b03198..e8d2675 100644 --- a/lua/zenbones/specs/dark.lua +++ b/lua/zenbones/specs/dark.lua @@ -102,7 +102,7 @@ local function generate(p, opt) 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". - 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| 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|. diff --git a/lua/zenbones/specs/init.lua b/lua/zenbones/specs/init.lua index 6ac22fc..c1c2ebc 100644 --- a/lua/zenbones/specs/init.lua +++ b/lua/zenbones/specs/init.lua @@ -19,6 +19,7 @@ function M.get_global_config(prefix, base_bg) darken_noncurrent_window = vim.g[prefix .. "_darken_noncurrent_window"], darken_comments = vim.g[prefix .. "_darken_comments"], darken_line_nr = vim.g[prefix .. "_darken_line_nr"], + darken_non_text = vim.g[prefix .. "_darken_non_text"], }, common) else 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_comments = vim.g[prefix .. "_lighten_comments"], lighten_line_nr = vim.g[prefix .. "_lighten_line_nr"], + lighten_non_text = vim.g[prefix .. "_lighten_non_text"], }, common) end end diff --git a/lua/zenbones/specs/light.lua b/lua/zenbones/specs/light.lua index 423488b..4066899 100644 --- a/lua/zenbones/specs/light.lua +++ b/lua/zenbones/specs/light.lua @@ -102,7 +102,7 @@ local function generate(p, opt) Visual { bg = p.fg.lightness(Normal.bg.l - 8) }, -- Visual mode 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| 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|.