mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-13 14:03:51 -05:00
add Tomorrow colorscheme
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
" Version: 0.0
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2013/08/22 19:05:48.
|
||||
" Last Change: 2013/08/22 19:31:24.
|
||||
" =============================================================================
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
||||
@@ -98,13 +98,48 @@ let s:guicolor = {
|
||||
\ 'green' : '#859900',
|
||||
\ }
|
||||
|
||||
function! s:convert(rgb)
|
||||
let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
|
||||
if len(rgb) == 0
|
||||
return 0
|
||||
endif
|
||||
if rgb[0] == 0xc0 && rgb[1] == 0xc0 && rgb[2] == 0xc0
|
||||
return 7
|
||||
elseif rgb[0] == 0x80 && rgb[1] == 0x80 && rgb[2] == 0x80
|
||||
return 8
|
||||
elseif (rgb[0] == 0x80 || rgb[0] == 0x00) && (rgb[1] == 0x80 || rgb[1] == 0x00) && (rgb[2] == 0x80 || rgb[2] == 0x00)
|
||||
return (rgb[0] / 0x80) + (rgb[1] / 0x80) * 2 + (rgb[1] / 0x80) * 4
|
||||
elseif abs(rgb[0]-rgb[1]) < 3 && abs(rgb[1]-rgb[2]) < 3 && abs(rgb[2]-rgb[0]) < 3
|
||||
return s:black((rgb[0] + rgb[1] + rgb[2]) / 3)
|
||||
else
|
||||
return 16 + ((s:nr(rgb[0]) * 6) + s:nr(rgb[1])) * 6 + s:nr(rgb[2])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:black(x)
|
||||
if a:x < 0x04
|
||||
return 16
|
||||
elseif a:x > 0xf4
|
||||
return 231
|
||||
elseif index([0x00, 0x5f, 0x87, 0xaf, 0xdf, 0xff], a:x) >= 0
|
||||
let l = a:x / 0x30
|
||||
return ((l * 6) + l) * 6 + l + 16
|
||||
else
|
||||
return 232 + (a:x < 8 ? 0 : a:x < 0x60 ? (a:x-8)/10 : a:x < 0x76 ? (a:x-0x60)/6+9 : (a:x-8)/10)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:nr(x)
|
||||
return a:x < 0x2f ? 0 : a:x < 0x73 ? 1 : a:x < 0x9b ? 2 : a:x < 0xc7 ? 3 : a:x < 0xef ? 4 : 5
|
||||
endfunction
|
||||
|
||||
function! lightline#colorscheme#fill(p)
|
||||
for k in values(a:p)
|
||||
for l in values(k)
|
||||
for m in l
|
||||
if len(m) < 4 && type(m[0]) == 1 && type(m[1]) == 1
|
||||
call insert(m, get(s:cuicolor, m[0], 15), 2)
|
||||
call insert(m, get(s:cuicolor, m[1], 15), 3)
|
||||
call insert(m, get(s:cuicolor, m[0], s:convert(m[0])), 2)
|
||||
call insert(m, get(s:cuicolor, m[1], s:convert(m[1])), 3)
|
||||
let m[0] = get(s:guicolor, m[0], m[0])
|
||||
let m[1] = get(s:guicolor, m[1], m[1])
|
||||
endif
|
||||
|
||||
55
autoload/lightline/colorscheme/Tomorrow.vim
Normal file
55
autoload/lightline/colorscheme/Tomorrow.vim
Normal file
@@ -0,0 +1,55 @@
|
||||
" =============================================================================
|
||||
" Filename: autoload/lightline/colorscheme/Tomorrow.vim
|
||||
" Version: 0.0
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2013/08/22 19:47:24.
|
||||
" =============================================================================
|
||||
if &background ==# 'light'
|
||||
let s:base03 = '#fafafa'
|
||||
let s:base023 = '#dfdfdf'
|
||||
let s:base02 = '#c8c8c8'
|
||||
let s:base01 = '#b4b4b4'
|
||||
let s:base00 = '#808080'
|
||||
let s:base0 = '#666666'
|
||||
let s:base1 = '#555555'
|
||||
let s:base2 = '#4f4f4f'
|
||||
let s:base3 = '#4d4d4c'
|
||||
let s:red = '#c82829'
|
||||
let s:orange = '#f5871f'
|
||||
let s:yellow = '#eab700'
|
||||
let s:green = '#718c00'
|
||||
let s:cyan = '#3e999f'
|
||||
let s:blue = '#4271ae'
|
||||
let s:magenta = '#8959a8'
|
||||
else
|
||||
let s:base3 = '#c5c8c6'
|
||||
let s:base2 = '#bababa'
|
||||
let s:base1 = '#a0a0a0'
|
||||
let s:base0 = '#909090'
|
||||
let s:base00 = '#666666'
|
||||
let s:base01 = '#555555'
|
||||
let s:base02 = '#434343'
|
||||
let s:base023 = '#303030'
|
||||
let s:base03 = '#1d1f21'
|
||||
let s:red = '#cc6666'
|
||||
let s:orange = '#de935f'
|
||||
let s:yellow = '#f0c674'
|
||||
let s:green = '#b5bd68'
|
||||
let s:cyan = '#8abeb7'
|
||||
let s:blue = '#81a2be'
|
||||
let s:magenta = '#b294bb'
|
||||
endif
|
||||
|
||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}}
|
||||
let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
|
||||
let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ], [ s:base0, s:base02 ] ]
|
||||
let s:p.inactive.right = [ [ s:base02, s:base01 ], [ s:base0, s:base02 ], [ s:base0, s:base02 ] ]
|
||||
let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base03 ] ]
|
||||
let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
|
||||
let s:p.replace.left = [ [ s:base02, s:orange ], [ s:base3, s:base01 ] ]
|
||||
let s:p.visual.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
|
||||
let s:p.normal.middle = [ [ s:base02, s:base02 ] ]
|
||||
let s:p.inactive.middle = [ [ s:base023, s:base023 ] ]
|
||||
|
||||
let g:lightline#colorscheme#Tomorrow#palette = lightline#colorscheme#fill(s:p)
|
||||
@@ -1,9 +1,9 @@
|
||||
" =============================================================================
|
||||
" Filename: autoload/lightline/colorscheme/wombat.vim
|
||||
" Filename: autoload/lightline/colorscheme/jellybeans.vim
|
||||
" Version: 0.0
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2013/08/22 18:50:17.
|
||||
" Last Change: 2013/08/22 19:40:13.
|
||||
" =============================================================================
|
||||
let s:base03 = [ '#151513', 233 ]
|
||||
let s:base02 = [ '#30302c ', 236 ]
|
||||
|
||||
Reference in New Issue
Block a user