Skip to content

Commit

Permalink
Add public API function to get Nord colors (#224)
Browse files Browse the repository at this point in the history
Implemented the `NordPalette` pubic API function that returns all Nord
colors as dictionary. This allows to use the colors in other Vim scripts
without the need to copy & paste the colors from the documentations or
the Nord Vim theme sources.

Co-authored-by: Arctic Ice Studio <development@arcticicestudio.com>
Co-authored-by: Sven Greb <development@svengreb.de>

Closes GH-224
  • Loading branch information
jandamm committed May 2, 2021
1 parent ea7ff9c commit 5867535
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions colors/nord.vim
Original file line number Diff line number Diff line change
Expand Up @@ -772,3 +772,17 @@ hi! link VimwikiList markdownListMarker
" YAML
" > stephpy/vim-yaml
call s:hi("yamlKey", s:nord7_gui, "", s:nord7_term, "", "", "")

"+------------+
"+ Public API +
"+------------+
"+--- Functions ---+

function! NordPalette() abort
let ret = {}
for color in range(16)
execute 'let ret["nord'.color.'"] = s:nord'.color.'_gui'
endfor
let ret["nord3_bright"] = s:nord3_gui_bright
return ret
endfunction

0 comments on commit 5867535

Please sign in to comment.