Alternative where text color is inverse of background.
This commit is contained in:
parent
21f5069e48
commit
08ec02a755
@ -349,8 +349,12 @@ function! s:tag_code(value)
|
|||||||
let l:str = s:mid(a:value, 1)
|
let l:str = s:mid(a:value, 1)
|
||||||
let l:match = match(l:str, '^#[a-fA-F0-9]\{6\}$')
|
let l:match = match(l:str, '^#[a-fA-F0-9]\{6\}$')
|
||||||
|
|
||||||
|
|
||||||
if l:match != -1
|
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
|
endif
|
||||||
|
|
||||||
let l:retstr .= '>'.s:safe_html_preformatted(l:str).'</code>'
|
let l:retstr .= '>'.s:safe_html_preformatted(l:str).'</code>'
|
||||||
|
Loading…
Reference in New Issue
Block a user