mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-14 22:43:50 -05:00
18 lines
515 B
VimL
18 lines
515 B
VimL
function! s:load()
|
|
let rgbfile = $VIMRUNTIME . '/rgb.txt'
|
|
let table = {}
|
|
if filereadable(rgbfile)
|
|
for _ in map(filter(readfile(rgbfile), 'v:val !~ "^!"'), 'matchlist(v:val, "^\\s*\\(\\d\\+\\)\\s\\+\\(\\d\\+\\)\\s\\+\\(\\d\\+\\)\\s\\+\\(.*\\)")[1:4]')
|
|
let table[tolower(_[3])] = _[0:2]
|
|
endfor
|
|
endif
|
|
return table
|
|
endfunction
|
|
|
|
let s:table = s:load()
|
|
|
|
function! lightline#colortable#name_to_rgb(name)
|
|
let name = tolower(a:name)
|
|
return has_key(s:table, name) ? s:table[name] : []
|
|
endfunction
|