diff --git a/README.md b/README.md index 9dc67cd..a7a5616 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,9 @@ use { -- Supported: terminal, qf, vista_kind, packer, nvim-tree, telescope, whichkey alternate_backgrounds = false, + -- Or make all backgrounds transparent + transparent_backgrounds = false, + -- Callback function to define custom color groups -- See 'lua/nordic/colors/example.lua' for example defitions custom_colors = function(c, s, cs) @@ -76,7 +79,8 @@ require('nordic').colorscheme({ italic = true, italic_comments = false, minimal_mode = false, - alternate_backgrounds = false + alternate_backgrounds = false, + transparent_backgrounds = false, }) ``` @@ -88,6 +92,7 @@ vim.g.nord_italic = true vim.g.nord_italic_comments = false vim.g.nord_minimal_mode = false vim.g.nord_alternate_backgrounds = false +vim.g.nord_transparent_backgrounds = false vim.cmd('colorscheme nordic') ``` @@ -99,6 +104,7 @@ let g:nord_italic = v:true let g:nord_italic_comments = v:false let g:nord_minimal_mode = v:false let g:nord_alternate_backgrounds = v:false +let g:nord_transparent_backgrounds = v:false colorscheme nordic ``` diff --git a/lua/nordic/colors/standard.lua b/lua/nordic/colors/standard.lua index c1cd5fa..3969850 100644 --- a/lua/nordic/colors/standard.lua +++ b/lua/nordic/colors/standard.lua @@ -8,8 +8,8 @@ return function(c, s, cs, opts) { 'LineNr', c.gray }, { 'MatchParen', c.bright_cyan, c.gray }, { 'NonText', c.bright_black }, - { 'Normal', c.dark_white, c.dark_black }, - { 'NormalAlt', c.dark_white, c.dark_black_alt }, + { 'Normal', c.dark_white, cs.bg_normal }, + { 'NormalAlt', c.dark_white, cs.bg_normal_alt }, { 'PMenu', c.dark_white, c.bright_black }, { 'PmenuSbar', c.dark_white, c.bright_black }, { 'PMenuSel', c.bright_cyan, c.gray, s.bold }, @@ -37,10 +37,10 @@ return function(c, s, cs, opts) --- Gutter --- { 'CursorColumn', c.none, c.black }, { 'CursorLineNr', c.dark_white, c.black }, - { 'Folded', c.gray, c.dark_black }, - { 'FoldColumn', c.gray, c.dark_black }, - { 'SignColumn', c.black, c.dark_black }, - { 'SignColumnAlt', c.black, c.dark_black_alt }, + { 'Folded', c.gray, cs.bg_normal }, + { 'FoldColumn', c.gray, cs.bg_normal }, + { 'SignColumn', c.black, cs.bg_normal }, + { 'SignColumnAlt', c.black, cs.bg_normal_alt }, -- Navigation --- { 'Directory', c.bright_cyan }, --- Prompt/Status --- @@ -66,17 +66,17 @@ return function(c, s, cs, opts) --- Editor--- { 'CursorLine', c.none, c.darkish_black }, { 'NormalFloat', c.white, c.none }, - { 'FloatBorder', c.grayish, c.dark_black }, - { 'FloatTitle', c.grayish, c.dark_black }, + { 'FloatBorder', c.grayish, cs.bg_normal }, + { 'FloatTitle', c.grayish, cs.bg_normal }, --- Prompt/Status --- - { 'StatusLine', c.dark_white, c.dark_black }, - { 'StatusLineNC', c.grayish, c.dark_black }, - { 'StatusLineTerm', c.dark_white, c.dark_black }, - { 'StatusLineTermNC', c.grayish, c.dark_black }, + { 'StatusLine', c.dark_white, cs.bg_normal }, + { 'StatusLineNC', c.grayish, cs.bg_normal }, + { 'StatusLineTerm', c.dark_white, cs.bg_normal }, + { 'StatusLineTermNC', c.grayish, cs.bg_normal }, --- Tabs --- - { 'TabLine', c.grayish, c.dark_black }, - { 'TabLineFill', c.grayish, c.dark_black }, - { 'TabLineSel', c.bright_white, c.dark_black }, + { 'TabLine', c.grayish, cs.bg_normal }, + { 'TabLineFill', c.grayish, cs.bg_normal }, + { 'TabLineSel', c.bright_white, cs.bg_normal }, } end @@ -84,8 +84,8 @@ return function(c, s, cs, opts) --- Editor--- { 'NormalFloat', c.white, c.black }, { 'CursorLine', c.none, c.black }, - { 'FloatBorder', c.black, c.dark_black }, - { 'FloatTitle', c.grayish, c.dark_black }, + { 'FloatBorder', c.black, cs.bg_normal }, + { 'FloatTitle', c.grayish, cs.bg_normal }, --- Prompt/Status --- { 'StatusLine', c.bright_cyan, c.gray }, { 'StatusLineNC', c.dark_white, c.black }, diff --git a/lua/nordic/colors/winshift.lua b/lua/nordic/colors/winshift.lua index 734eb2a..431b449 100644 --- a/lua/nordic/colors/winshift.lua +++ b/lua/nordic/colors/winshift.lua @@ -1,11 +1,11 @@ -- 'sindrets/winshift.nvim' -return function(c, s) +return function(c, s, cs) return { - { { 'WinShiftNormal', 'WinShiftEndOfBuffer' }, c.none, c.dark_black_alt }, - { 'WinShiftLineNr', c.yellow, c.dark_black_alt }, - { 'WinShiftCursorLineNr', c.yellow, c.dark_black_alt, s.bold }, - { 'WinShiftSignColumn', c.cyan, c.dark_black_alt }, + { { 'WinShiftNormal', 'WinShiftEndOfBuffer' }, c.none, cs.bg_normal_alt }, + { 'WinShiftLineNr', c.yellow, cs.bg_normal_alt }, + { 'WinShiftCursorLineNr', c.yellow, cs.bg_normal_alt, s.bold }, + { 'WinShiftSignColumn', c.cyan, cs.bg_normal_alt }, { 'WinShiftWindowPicker', c.purple, c.blue, s.bold }, - { 'WinShiftFoldColumn', c.cyan, c.dark_black_alt }, + { 'WinShiftFoldColumn', c.cyan, cs.bg_normal_alt }, } end diff --git a/lua/nordic/init.lua b/lua/nordic/init.lua index 668653a..dba721f 100644 --- a/lua/nordic/init.lua +++ b/lua/nordic/init.lua @@ -9,6 +9,7 @@ local default_opts = { italic_comments = false, minimal_mode = false, alternate_backgrounds = false, + transparent_backgrounds = false, custom_colors = function() return {} end, @@ -85,7 +86,12 @@ local function create_arguments(options, alternatives) underline = options.underline_option and s[options.underline_option] or s.none, italic = (options.italic == true or options.italic == nil) and s.italic or s.none, comments = options.italic_comments and s.italic or s.none, + bg_normal = options.transparent_backgrounds == false and palette.dark_black or s.none, + bg_normal_alt = options.transparent_backgrounds == false and palette.dark_black_alt or s.none, bg = function(name) + if options.transparent_backgrounds then + return s.none + end local found = vim.tbl_contains(alternatives.extensions, name) return found and palette.dark_black_alt or palette.dark_black end,