1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 07:00:04 +08:00

Colorscheme spacevim (#3074)

* Fix SpaceVim colorscheme

* Fix
This commit is contained in:
Wang Shidong 2019-09-21 15:48:58 +08:00 committed by GitHub
parent ecf73e3e7e
commit c693bafa39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 26 deletions

View File

@ -22,7 +22,7 @@ function! SpaceVim#mapping#guide#theme#SpaceVim#palette() abort
\ ['#282828' , '#FFA500' , 250, 97],
\ ['#d75fd7' , '#4e4e4e' , 170 , 239],
\ ['#c6c6c6' , '#3a3a3a' , 251 , 237],
\ ['#2c323c', 16],
\ ['#1c1c1c', 16],
\ ['#282828', '#00BFFF', 114, 152],
\ ['#2c323c', '#ff8787', 114, 210],
\ ['#2c323c', '#d75f5f', 114, 167],

View File

@ -25,36 +25,49 @@ let s:HIAPI = SpaceVim#api#import('vim#highlight')
let s:COLOR = SpaceVim#api#import('color')
let s:is_dark=(&background ==# 'dark')
function! s:hi(items) abort
for [item, fg, bg, cterm, gui] in a:items
call s:HIAPI.hi(
\ {
\ 'name' : item,
\ 'ctermbg' : bg,
\ 'ctermfg' : fg,
\ 'guifg' : s:COLOR.nr2str(fg),
\ 'guibg' : s:COLOR.nr2str(bg),
\ 'cterm' : cterm,
\ 'gui' : gui,
\ }
\ )
endfor
function! s:hi(item, fg, bg, cterm, gui) abort
call s:HIAPI.hi(
\ {
\ 'name' : a:item,
\ 'ctermbg' : a:bg,
\ 'ctermfg' : a:fg,
\ 'guifg' : s:COLOR.nr2str(a:fg),
\ 'guibg' : s:COLOR.nr2str(a:bg),
\ 'cterm' : a:cterm,
\ 'gui' : a:gui,
\ }
\ )
endfunction
" color palette
let s:fg = 249
let s:bg = 235
let s:bg = max([s:bg, 233])
let s:bias = s:bg - 235
let s:bg0 = s:bg - 1
let s:bg1 = s:bg + 1
let s:bg2 = s:bg + 2
let s:bg3 = s:bg + 3
let s:bg4 = s:bg + 4
let s:palette = {
\ 'dark' : [
\ ['Normal' , 249 , s:bg , 'None' , 'None'] ,
\ ['LineNr' , 238 , 235 , 'None' , 'None'] ,
\ ['Boolean' , 178 , '' , 'None' , 'None'] ,
\ ['Character' , 75 , '' , 'None' , 'None'] ,
\ ['ColorColumn' , '' , 236 , 'None' , 'None'] ,
\ ['ColorColumn' , '' , s:bg0 , 'None' , 'None'] ,
\ ['Comment' , 30 , '' , 'None' , 'italic'] ,
\ ['Conditional' , 68 , '' , 'bold' , 'bold'] ,
\ ['Constant' , 218 , '' , 'None' , 'None'] ,
\ ['Cursor' , 235 , 178 , 'bold' , 'bold'] ,
\ ['CursorColumn' , '' , 236 , 'None' , 'None'] ,
\ ['CursorLine' , '' , 236 , 'None' , 'None'] ,
\ ['CursorLineNr' , 134 , 236 , 'None' , 'None'] ,
\ ['CursorColumn' , '' , s:bg0 , 'None' , 'None'] ,
\ ['CursorLine' , '' , s:bg0 , 'None' , 'None'] ,
\ ['CursorLineNr' , 170 , s:bg0 , 'None' , 'None'] ,
\ ['Debug' , 225 , '' , 'None' , 'None'] ,
\ ['Define' , 177 , '' , 'None' , 'None'] ,
\ ['Delimiter' , 151 , '' , 'None' , 'None'] ,
@ -75,17 +88,15 @@ let s:palette = {
\ ['IncSearch' , 16 , 76 , 'bold' , 'bold'] ,
\ ['Keyword' , 68 , '' , 'bold' , 'bold'] ,
\ ['Label' , 104 , '' , 'None' , 'None'] ,
\ ['LineNr' , 238 , 235 , 'None' , 'None'] ,
\ ['Macro' , 140 , '' , 'None' , 'None'] ,
\ ['MatchParen' , 40 , 234 , 'bold , underline' , 'bold , underline'] ,
\ ['ModeMsg' , 229 , '' , 'None' , 'None'] ,
\ ['NonText' , 241 , '' , 'None' , 'None'] ,
\ ['Normal' , 249 , 235 , 'None' , 'None'] ,
\ ['Number' , 176 , '' , 'None' , 'None'] ,
\ ['Operator' , 111 , '' , 'None' , 'None'] ,
\ ['Pmenu' , 141 , 236 , 'None' , 'None'] ,
\ ['PmenuSbar' , 28 , 233 , 'None' , 'None'] ,
\ ['Pmenu' , 141 , s:bg1 , 'None' , 'None'] ,
\ ['PmenuSel' , 251 , 97 , 'None' , 'None'] ,
\ ['PmenuSbar' , 28 , 233 , 'None' , 'None'] ,
\ ['PmenuThumb' , 160 , 97 , 'None' , 'None'] ,
\ ['PreCondit' , 139 , '' , 'None' , 'None'] ,
\ ['PreProc' , 176 , '' , 'None' , 'None'] ,
@ -118,8 +129,8 @@ let s:palette = {
\ ['Type' , 68 , '' , 'None' , 'None'] ,
\ ['Typedef' , 68 , '' , 'None' , 'None'] ,
\ ['VertSplit' , 234 , '' , 'None' , 'None'] ,
\ ['Visual' , '' , 238 , 'None' , 'None'] ,
\ ['VisualNOS' , '' , 238 , 'None' , 'None'] ,
\ ['Visual' , '' , s:bg3 , 'None' , 'None'] ,
\ ['VisualNOS' , '' , s:bg3 , 'None' , 'None'] ,
\ ['Warning' , 136 , '' , 'bold' , 'bold'] ,
\ ['WarningMsg' , 136 , '' , 'bold' , 'bold'] ,
\ ['WildMenu' , 214 , 239 , 'None' , 'None'] ,
@ -129,8 +140,16 @@ let s:palette = {
\ ],
\ }
call s:hi(s:palette[s:is_dark ? 'dark' : 'light'])
let item = []
for item in s:palette[s:is_dark ? 'dark' : 'light']
call call('s:hi', item)
endfor
unlet item
" vim-startify
hi link StartifyFile Normal
call s:hi('StartifyHeader' , 177 , '' , 'none' , 'none')
call s:hi('startifySection' , 68 , '' , 'bold' , 'bold')
if s:is_dark
set background=dark