1
"=============================================================================
2
" SpaceVim.vim --- SpaceVim colorscheme
3
" Copyright (c) 2016-2020 Wang Shidong & Contributors
4
" Author: Wang Shidong < wsdjeg at 163.com >
5
" URL: https://spacevim.org
6
" License: GPLv3
7
"=============================================================================
8

9

10 0
if v:version > 580
11 0
  hi clear
12 0
  if exists('syntax_on')
13 0
    syntax reset
14
  endif
15
endif
16

17 0
if !(has('termguicolors') && &termguicolors) && !has('gui_running') && &t_Co != 256
18
  " prevent change statuslines
19 0
  finish
20 0
else
21 0
  let g:colors_name='SpaceVim'
22
endif
23

24 0
let s:HIAPI = SpaceVim#api#import('vim#highlight')
25 0
let s:COLOR = SpaceVim#api#import('color')
26 0
let s:is_dark=(&background ==# 'dark')
27

28 0
function! s:hi(item, fg, bg, cterm, gui) abort
29 0
  call s:HIAPI.hi(
30 0
        \ {
31 0
        \ 'name' : a:item,
32 0
        \ 'ctermbg' : a:bg,
33 0
        \ 'ctermfg' : a:fg,
34 0
        \ 'guifg' : s:COLOR.nr2str(a:fg),
35 0
        \ 'guibg' : s:COLOR.nr2str(a:bg),
36 0
        \ 'cterm' : a:cterm,
37 0
        \ 'gui' : a:gui,
38 0
        \ }
39 0
        \ )
40
endfunction
41

42
" color palette
43

44

45 0
let s:fg = 249
46 0
let s:bg = 235
47 0
let s:bg = max([s:bg, 233])
48

49 0
let s:bias = s:bg - 235
50 0
let s:bg0 = s:bg - 1
51 0
let s:bg1 = s:bg + 1
52 0
let s:bg2 = s:bg + 2
53 0
let s:bg3 = s:bg + 3
54 0
let s:bg4 = s:bg + 4
55

56

57 0
let s:palette = {
58 0
      \ 'dark' : [
59 0
      \ ['Normal'           , 249 , s:bg , 'None'      , 'None']      ,
60 0
      \ ['LineNr'           , 238 , 235 , 'None'      , 'None']      ,
61 0
      \ ['Boolean'          , 178 , ''  , 'None'      , 'None']      ,
62 0
      \ ['Character'        , 75  , ''  , 'None'      , 'None']      ,
63 0
      \ ['ColorColumn'      , ''  , s:bg0 , 'None'      , 'None']      ,
64 0
      \ ['Comment'          , 30  , ''  , 'None'      , 'italic']    ,
65 0
      \ ['Conditional'      , 68  , ''  , 'bold'      , 'bold']      ,
66 0
      \ ['Constant'         , 218 , ''  , 'None'      , 'None']      ,
67 0
      \ ['Cursor'           , 235 , 178 , 'bold'      , 'bold']      ,
68 0
      \ ['CursorColumn'     , ''  , s:bg0 , 'None'      , 'None']      ,
69 0
      \ ['CursorLine'       , ''  , s:bg0 , 'None'      , 'None']      ,
70 0
      \ ['CursorLineNr'     , 170 , s:bg0 , 'None'      , 'None']      ,
71 0
      \ ['Debug'            , 225 , ''  , 'None'      , 'None']      ,
72 0
      \ ['Define'           , 177 , ''  , 'None'      , 'None']      ,
73 0
      \ ['Delimiter'        , 151 , ''  , 'None'      , 'None']      ,
74 0
      \ ['DiffAdd'          , ''  , 24  , 'None'      , 'None']      ,
75 0
      \ ['DiffChange'       , 181 , 239 , 'None'      , 'None']      ,
76 0
      \ ['DiffDelete'       , 162 , 53  , 'None'      , 'None']      ,
77 0
      \ ['DiffText'         , ''  , 102 , 'None'      , 'None']      ,
78 0
      \ ['Directory'        , 67  , ''  , 'bold'      , 'bold']      ,
79 0
      \ ['Error'            , 160 , 235 , 'bold'      , 'bold']      ,
80 0
      \ ['ErrorMsg'         , 196 , 235 , 'bold'      , 'bold']      ,
81 0
      \ ['Exception'        , 204 , ''  , 'bold'      , 'bold']      ,
82 0
      \ ['Float'            , 135 , ''  , 'None'      , 'None']      ,
83 0
      \ ['FoldColumn'       , 67  , 236 , 'None'      , 'None']      ,
84 0
      \ ['Folded'           , 133 , 236 , 'bold'      , 'bold']      ,
85 0
      \ ['Function'         , 169 , ''  , 'bold'      , 'bold']      ,
86 0
      \ ['Identifier'       , 167 , ''  , 'None'      , 'None']      ,
87 0
      \ ['Ignore'           , 244 , ''  , 'None'      , 'None']      ,
88 0
      \ ['IncSearch'        , 16  , 76  , 'bold'      , 'bold']      ,
89 0
      \ ['Keyword'          , 68  , ''  , 'bold'      , 'bold']      ,
90 0
      \ ['Label'            , 104 , ''  , 'None'      , 'None']      ,
91 0
      \ ['Macro'            , 140 , ''  , 'None'      , 'None']      ,
92 0
      \ ['MatchParen'       , 40  , 234 , 'bold       , underline'   , 'bold , underline'] ,
93 0
      \ ['ModeMsg'          , 229 , ''  , 'None'      , 'None']      ,
94 0
      \ ['NonText'          , 241 , ''  , 'None'      , 'None']      ,
95 0
      \ ['Number'           , 176 , ''  , 'None'      , 'None']      ,
96 0
      \ ['Operator'         , 111 , ''  , 'None'      , 'None']      ,
97 0
      \ ['Pmenu'            , 141 , s:bg1 , 'None'      , 'None']      ,
98 0
      \ ['PmenuSel'         , 251 , 97  , 'None'      , 'None']      ,
99 0
      \ ['PmenuSbar'        , 28  , 233 , 'None'      , 'None']      ,
100 0
      \ ['PmenuThumb'       , 160 , 97  , 'None'      , 'None']      ,
101 0
      \ ['PreCondit'        , 139 , ''  , 'None'      , 'None']      ,
102 0
      \ ['PreProc'          , 176 , ''  , 'None'      , 'None']      ,
103 0
      \ ['Question'         , 81  , ''  , 'None'      , 'None']      ,
104 0
      \ ['Repeat'           , 68  , ''  , 'bold'      , 'bold']      ,
105 0
      \ ['Search'           , 16  , 76  , 'bold'      , 'bold']      ,
106 0
      \ ['SignColumn'       , 118 , 235 , 'None'      , 'None']      ,
107 0
      \ ['Special'          , 169 , ''  , 'None'      , 'None']      ,
108 0
      \ ['SpecialChar'      , 171 , ''  , 'bold'      , 'bold']      ,
109 0
      \ ['SpecialComment'   , 24  , ''  , 'None'      , 'None']      ,
110 0
      \ ['SpecialKey'       , 59  , ''  , 'None'      , 'None']      ,
111 0
      \ ['SpellBad'         , 168 , ''  , 'underline' , 'undercurl'] ,
112 0
      \ ['SpellCap'         , 110 , ''  , 'underline' , 'undercurl'] ,
113 0
      \ ['SpellLocal'       , 253 , ''  , 'underline' , 'undercurl'] ,
114 0
      \ ['SpellRare'        , 218 , ''  , 'underline' , 'undercurl'] ,
115 0
      \ ['Statement'        , 68  , ''  , 'None'      , 'None']      ,
116 0
      \ ['StatusLine'       , 140 , 238 , 'None'      , 'None']      ,
117 0
      \ ['StatusLineNC'     , 242 , 237 , 'None'      , 'None']      ,
118 0
      \ ['StatusLineTerm'   , 140 , 238 , 'bold'      , 'bold']      ,
119 0
      \ ['StatusLineTermNC' , 244 , 237 , 'bold'      , 'bold']      ,
120 0
      \ ['StorageClass'     , 178 , ''  , 'bold'      , 'bold']      ,
121 0
      \ ['String'           , 36  , ''  , 'None'      , 'None']      ,
122 0
      \ ['Structure'        , 68  , ''  , 'bold'      , 'bold']      ,
123 0
      \ ['TabLine'          , 66  , 239 , 'None'      , 'None']      ,
124 0
      \ ['TabLineFill'      , 145 , 238 , 'None'      , 'None']      ,
125 0
      \ ['TabLineSel'       , 178 , 240 , 'None'      , 'None']      ,
126 0
      \ ['Tag'              , 161 , ''  , 'None'      , 'None']      ,
127 0
      \ ['Title'            , 176 , ''  , 'None'      , 'None']      ,
128 0
      \ ['Todo'             , 172 , 235 , 'bold'      , 'bold']      ,
129 0
      \ ['Type'             , 68  , ''  , 'None'      , 'None']      ,
130 0
      \ ['Typedef'          , 68  , ''  , 'None'      , 'None']      ,
131 0
      \ ['VertSplit'        , 234 , ''  , 'None'      , 'None']      ,
132 0
      \ ['Visual'           , ''  , s:bg3 , 'None'      , 'None']      ,
133 0
      \ ['VisualNOS'        , ''  , s:bg3 , 'None'      , 'None']      ,
134 0
      \ ['Warning'          , 136 , ''  , 'bold'      , 'bold']      ,
135 0
      \ ['WarningMsg'       , 136 , ''  , 'bold'      , 'bold']      ,
136 0
      \ ['WildMenu'         , 214 , 239 , 'None'      , 'None']      ,
137 0
      \ ['VertSplit'        , 235 , 238 , 'None'      , 'None']      ,
138 0
      \ ]                   ,
139 0
      \ 'light' : [
140 0
      \ ],
141 0
      \ }
142

143 0
let item = []
144 0
for item in s:palette[s:is_dark ? 'dark' : 'light'] 
145 0
  call call('s:hi', item)
146
endfor
147 0
unlet item
148

149
" vim-startify
150 0
hi link StartifyFile Normal
151 0
call s:hi('StartifyHeader'  , 177 , '' , 'none' , 'none')
152 0
call s:hi('startifySection' , 68  , '' , 'bold' , 'bold')
153

154 0
if s:is_dark
155 0
  set background=dark
156
endif

Read our documentation on viewing source code .

Loading