vimwiki

Personal wiki for vim
git clone https://github.com/vimwiki/vimwiki.git
Log | Files | Refs | README | LICENSE

commit 08ec02a7554e9981967f0a4443ea310b7fbdccd8
parent 21f5069e48d92af17a0b8b805342e956282e19ac
Author: Hugo Hörnquist <hugo@lysator.liu.se>
Date:   Tue, 19 Feb 2019 21:04:57 +0100

Alternative where text color is inverse of background.

Diffstat:
Mautoload/vimwiki/html.vim | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim @@ -349,8 +349,12 @@ function! s:tag_code(value) let l:str = s:mid(a:value, 1) let l:match = match(l:str, '^#[a-fA-F0-9]\{6\}$') + if l:match != -1 - let l:retstr .= " style='background-color: " . l:str . ";'" + let l:inv_color = 0xFFFFFF - eval("0x" . l:str[1:]) + + let l:retstr .= printf(" style='background-color: %s; color: #%x;'", + \ l:str, l:inv_color) endif let l:retstr .= '>'.s:safe_html_preformatted(l:str).'</code>'