mirror of
https://github.com/BourgeoisBear/clrzr.git
synced 2026-09-10 07:16:27 -04:00
support for #aarrggbb format, close #28
This commit is contained in:
parent
acbffdc39a
commit
7999427668
|
|
@ -99,7 +99,7 @@ function! s:SetMatcher(color, pat) "{{{1
|
|||
endif
|
||||
endfunction
|
||||
|
||||
"i Color Converters {{{1
|
||||
" Color Converters {{{1
|
||||
function! s:RgbBgColor() "{{{2
|
||||
let bg = synIDattr(synIDtrans(hlID("Normal")), "bg")
|
||||
let r = str2nr(bg[1:2], 16)
|
||||
|
|
@ -192,8 +192,13 @@ function! s:HexCode(str, lineno) "{{{2
|
|||
let ha = tolower(foundcolor[7:8])
|
||||
endif
|
||||
if len(foundcolor) == 9
|
||||
let alpha = foundcolor[7:8]
|
||||
let foundcolor = foundcolor[0:6]
|
||||
if get(g:, 'colorizer_hex_alpha_first') == 1
|
||||
let alpha = foundcolor[1:2]
|
||||
let foundcolor = '#'.foundcolor[3:8]
|
||||
else
|
||||
let alpha = foundcolor[7:8]
|
||||
let foundcolor = foundcolor[0:6]
|
||||
endif
|
||||
else
|
||||
let alpha = 'ff'
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@
|
|||
" let g:colorizer_maxlines = 1000
|
||||
" -1 means unlimited number of lines
|
||||
"
|
||||
" There are color strings in the format #RRGGBBAA and #AARRGGBB. The former is
|
||||
" more common so it's the default. If you want the latter, set the following:
|
||||
" let g:colorizer_hex_alpha_first = 1
|
||||
"
|
||||
" Note: if you modify a color string in normal mode, if the cursor is still on
|
||||
" that line, it'll take 'updatetime' seconds to update. You can use
|
||||
" :ColorHighlight (or your key mapping) again to force update.
|
||||
|
|
|
|||
Loading…
Reference in a new issue