Skip to content

Commit aedc1c0

Browse files
committed
Add light background version (Fix #1)
1 parent f4c9ea8 commit aedc1c0

File tree

1 file changed

+254
-125
lines changed

1 file changed

+254
-125
lines changed

colors/open-color.vim

Lines changed: 254 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
let s:save_cpo = &cpo
99
set cpo&vim
1010

11+
let s:background = &background
12+
1113
" Returns an approximate gray index for the given gray level
1214
function! s:GrayNumber(x)
1315
if &t_Co == 88
@@ -245,134 +247,261 @@ if exists('g:syntax_on')
245247
endif
246248

247249
if has('gui_running') || &t_Co == 88 || &t_Co == 256
248-
" :help group-name
249-
" :help highlight-groups
250-
call s:Hi('Normal', s:oc['gray'][2], s:oc['gray'][8])
251-
call s:Hi('LineNr', s:oc['gray'][6], '')
252-
call s:Hi('Visual', '', s:oc['gray'][6])
253-
call s:Hi('VisualNOS', '', s:oc['gray'][6])
254-
255-
" Comment
256-
call s:Hi('Comment', s:oc['gray'][6], '')
257-
258-
" Constant
259-
call s:Hi('Constant', s:oc['yellow'][4], '')
260-
call s:Hi('String', s:oc['lime'][4], '')
261-
call s:Hi('Character', s:oc['orange'][4], '')
262-
call s:Hi('Number', s:oc['orange'][4], '')
263-
call s:Hi('Boolean', s:oc['orange'][4], '')
264-
call s:Hi('Float', s:oc['orange'][4], '')
265-
266-
" Identifier
267-
call s:Hi('Identifier', s:oc['yellow'][2], '')
268-
269-
" Statement
270-
call s:Hi('Statement', s:oc['violet'][2], '')
271-
call s:Hi('Conditional', s:oc['indigo'][3], '')
272-
call s:Hi('Repeat', s:oc['indigo'][3], '')
273-
call s:Hi('Operator', s:oc['cyan'][2], '')
274-
275-
" PreProc
276-
call s:Hi('PreProc', s:oc['violet'][2], '')
277-
278-
" Type
279-
call s:Hi('Type', s:oc['cyan'][2], '')
280-
281-
" Special
282-
call s:Hi('Special', s:oc['yellow'][2], '')
283-
call s:Hi('Delimiter', s:oc['gray'][2], '')
284-
call s:Hi('StringDelimiter', s:oc['gray'][2], '')
285-
286-
" Underlined
287-
call s:Hi('Underlined', s:oc['cyan'][2], '')
288-
289-
" Error"
290-
call s:Hi('Error', s:oc['gray'][2], s:oc['red'][5])
291-
292-
" Todo
293-
call s:Hi('Todo', s:oc['gray'][9], s:oc['lime'][4])
294-
295-
" set textwidth=80 colorcolumn+=1
296-
call s:Hi('ColorColumn', '', s:oc['gray'][9])
297-
298-
" set cursorline
299-
call s:Hi('CursorLine', '', s:oc['gray'][9])
300-
call s:Hi('CursorLineNr', s:oc['yellow'][2], s:oc['gray'][9])
301-
" set cursorcolumn
302-
call s:Hi('CursorColumn', '', s:oc['gray'][9])
303-
highlight CursorLine cterm=NONE
304-
highlight CursorLineNr cterm=NONE
305-
306-
call s:Hi('Directory', s:oc['indigo'][3], '')
307-
308-
call s:Hi('DiffAdd', 'NONE', s:oc['lime'][9])
309-
call s:Hi('DiffDelete', 'NONE', s:oc['red'][5])
310-
call s:Hi('DiffChange', 'NONE', s:oc['indigo'][9])
311-
call s:Hi('DiffText', 'NONE', s:oc['cyan'][5])
312-
call s:Hi('diffAdded', s:oc['lime'][4], '')
313-
call s:Hi('diffRemoved', s:oc['red'][5], '')
314-
315-
call s:Hi('VertSplit', s:oc['gray'][9], s:oc['gray'][9])
316-
317-
call s:Hi('Folded', s:oc['gray'][6], s:oc['gray'][8])
318-
" set foldcolumn=1
319-
call s:Hi('FoldColumn', s:oc['gray'][6], s:oc['gray'][8])
320-
call s:Hi('MatchParen', '', s:oc['gray'][6])
321-
322-
" -- INSERT --
323-
call s:Hi('ModeMsg', s:oc['gray'][2], '')
324-
call s:Hi('MoreMsg', s:oc['lime'][4], '')
325-
" Search hit bottom
326-
call s:Hi('WarningMsg', s:oc['red'][5], '')
327-
328-
" let &showbreak = '> '
329-
call s:Hi('NonText', s:oc['gray'][6], '')
330-
331-
" Popup menu
332-
call s:Hi('Pmenu', s:oc['gray'][2], s:oc['gray'][9])
333-
call s:Hi('PmenuSel', s:oc['gray'][9], s:oc['gray'][2])
334-
call s:Hi('PmenuSbar', '', s:oc['gray'][6])
335-
call s:Hi('PmenuThumb', '', s:oc['gray'][2])
336-
337-
call s:Hi('Search', s:oc['gray'][9], s:oc['yellow'][2])
338-
" call s:Hi('IncSearch', '', '')
339-
340-
" :map, listchars
341-
call s:Hi('SpecialKey', s:oc['gray'][6], '')
342-
343-
call s:Hi('StatusLine', s:oc['gray'][9], s:oc['lime'][4])
344-
call s:Hi('StatusLineNC', s:oc['gray'][9], s:oc['gray'][6])
345-
call s:Hi('TabLineFill', s:oc['gray'][9], '')
346-
call s:Hi('TabLineSel', s:oc['gray'][8], s:oc['gray'][6])
347-
call s:Hi('TabLine', s:oc['gray'][6], s:oc['gray'][9])
348-
call s:Hi('WildMenu', s:oc['gray'][9], s:oc['lime'][4])
349-
350-
" :set all
351-
call s:Hi('Title', s:oc['indigo'][3], '')
352-
353-
call s:Hi('Conceal', s:oc['gray'][6], s:oc['gray'][9])
354-
call s:Hi('Ignore', s:oc['gray'][6], s:oc['gray'][8])
355-
356-
" vim-gitgutter
357-
call s:Hi('GitGutterAdd', s:oc['lime'][4], '')
358-
call s:Hi('GitGutterChange', s:oc['yellow'][2], '')
359-
call s:Hi('GitGutterDelete', s:oc['red'][5], '')
360-
call s:Hi('GitGutterChangeDelete', s:oc['yellow'][2], '')
361-
362-
" vim-ruby
363-
call s:Hi('rubyClass', s:oc['violet'][2], '')
364-
call s:Hi('rubyRegexp', s:oc['lime'][4], '')
365-
call s:Hi('rubyRegexpDelimiter', s:oc['lime'][4], '')
366-
call s:Hi('rubyArrayDelimiter', s:oc['gray'][2], '')
367-
call s:Hi('rubyBlockParameterList', s:oc['gray'][2], '')
368-
call s:Hi('rubyCurlyBlockDelimiter', s:oc['gray'][2], '')
369-
call s:Hi('rubyInterpolationDelimiter', s:oc['orange'][4], '')
370-
" ARGV, $stdout
371-
call s:Hi('rubyPredefinedIdentifier', s:oc['red'][5], '')
250+
if s:background ==# 'dark'
251+
" :help group-name
252+
" :help highlight-groups
253+
call s:Hi('Normal', s:oc['gray'][2], s:oc['gray'][8])
254+
call s:Hi('LineNr', s:oc['gray'][6], '')
255+
call s:Hi('Visual', '', s:oc['gray'][6])
256+
call s:Hi('VisualNOS', '', s:oc['gray'][6])
257+
258+
" Comment
259+
call s:Hi('Comment', s:oc['gray'][6], '')
260+
261+
" Constant
262+
call s:Hi('Constant', s:oc['yellow'][4], '')
263+
call s:Hi('String', s:oc['lime'][4], '')
264+
call s:Hi('Character', s:oc['orange'][4], '')
265+
call s:Hi('Number', s:oc['orange'][4], '')
266+
call s:Hi('Boolean', s:oc['orange'][4], '')
267+
call s:Hi('Float', s:oc['orange'][4], '')
268+
269+
" Identifier
270+
call s:Hi('Identifier', s:oc['yellow'][2], '')
271+
272+
" Statement
273+
call s:Hi('Statement', s:oc['violet'][2], '')
274+
call s:Hi('Conditional', s:oc['indigo'][3], '')
275+
call s:Hi('Repeat', s:oc['indigo'][3], '')
276+
call s:Hi('Operator', s:oc['cyan'][2], '')
277+
278+
" PreProc
279+
call s:Hi('PreProc', s:oc['violet'][2], '')
280+
281+
" Type
282+
call s:Hi('Type', s:oc['cyan'][2], '')
283+
284+
" Special
285+
call s:Hi('Special', s:oc['yellow'][2], '')
286+
call s:Hi('Delimiter', s:oc['gray'][2], '')
287+
call s:Hi('StringDelimiter', s:oc['gray'][2], '')
288+
289+
" Underlined
290+
call s:Hi('Underlined', s:oc['cyan'][2], '')
291+
292+
" Error"
293+
call s:Hi('Error', s:oc['gray'][2], s:oc['red'][5])
294+
295+
" Todo
296+
call s:Hi('Todo', s:oc['gray'][9], s:oc['lime'][4])
297+
298+
" set textwidth=80 colorcolumn+=1
299+
call s:Hi('ColorColumn', '', s:oc['gray'][9])
300+
301+
" set cursorline
302+
call s:Hi('CursorLine', '', s:oc['gray'][9])
303+
call s:Hi('CursorLineNr', s:oc['yellow'][2], s:oc['gray'][9])
304+
" set cursorcolumn
305+
call s:Hi('CursorColumn', '', s:oc['gray'][9])
306+
highlight CursorLine cterm=NONE
307+
highlight CursorLineNr cterm=NONE
308+
309+
call s:Hi('Directory', s:oc['indigo'][3], '')
310+
311+
call s:Hi('DiffAdd', 'NONE', s:oc['lime'][9])
312+
call s:Hi('DiffDelete', 'NONE', s:oc['red'][5])
313+
call s:Hi('DiffChange', 'NONE', s:oc['indigo'][9])
314+
call s:Hi('DiffText', 'NONE', s:oc['cyan'][5])
315+
call s:Hi('diffAdded', s:oc['lime'][4], '')
316+
call s:Hi('diffRemoved', s:oc['red'][5], '')
317+
318+
call s:Hi('VertSplit', s:oc['gray'][9], s:oc['gray'][9])
319+
320+
call s:Hi('Folded', s:oc['gray'][6], s:oc['gray'][8])
321+
" set foldcolumn=1
322+
call s:Hi('FoldColumn', s:oc['gray'][6], s:oc['gray'][8])
323+
call s:Hi('MatchParen', '', s:oc['gray'][6])
324+
325+
" -- INSERT --
326+
call s:Hi('ModeMsg', s:oc['gray'][2], '')
327+
call s:Hi('MoreMsg', s:oc['lime'][4], '')
328+
" Search hit bottom
329+
call s:Hi('WarningMsg', s:oc['red'][5], '')
330+
331+
" let &showbreak = '> '
332+
call s:Hi('NonText', s:oc['gray'][6], '')
333+
334+
" Popup menu
335+
call s:Hi('Pmenu', s:oc['gray'][2], s:oc['gray'][9])
336+
call s:Hi('PmenuSel', s:oc['gray'][9], s:oc['gray'][2])
337+
call s:Hi('PmenuSbar', '', s:oc['gray'][6])
338+
call s:Hi('PmenuThumb', '', s:oc['gray'][2])
339+
340+
call s:Hi('Search', s:oc['gray'][9], s:oc['yellow'][2])
341+
" call s:Hi('IncSearch', '', '')
342+
343+
" :map, listchars
344+
call s:Hi('SpecialKey', s:oc['gray'][6], '')
345+
346+
call s:Hi('StatusLine', s:oc['gray'][9], s:oc['lime'][4])
347+
call s:Hi('StatusLineNC', s:oc['gray'][9], s:oc['gray'][6])
348+
call s:Hi('TabLineFill', s:oc['gray'][9], '')
349+
call s:Hi('TabLineSel', s:oc['gray'][8], s:oc['gray'][6])
350+
call s:Hi('TabLine', s:oc['gray'][6], s:oc['gray'][9])
351+
call s:Hi('WildMenu', s:oc['gray'][9], s:oc['lime'][4])
352+
353+
" :set all
354+
call s:Hi('Title', s:oc['indigo'][3], '')
355+
356+
call s:Hi('Conceal', s:oc['gray'][6], s:oc['gray'][9])
357+
call s:Hi('Ignore', s:oc['gray'][6], s:oc['gray'][8])
358+
359+
" vim-gitgutter
360+
call s:Hi('GitGutterAdd', s:oc['lime'][4], '')
361+
call s:Hi('GitGutterChange', s:oc['yellow'][2], '')
362+
call s:Hi('GitGutterDelete', s:oc['red'][5], '')
363+
call s:Hi('GitGutterChangeDelete', s:oc['yellow'][2], '')
364+
365+
" vim-ruby
366+
call s:Hi('rubyClass', s:oc['violet'][2], '')
367+
call s:Hi('rubyRegexp', s:oc['lime'][4], '')
368+
call s:Hi('rubyRegexpDelimiter', s:oc['lime'][4], '')
369+
call s:Hi('rubyArrayDelimiter', s:oc['gray'][2], '')
370+
call s:Hi('rubyBlockParameterList', s:oc['gray'][2], '')
371+
call s:Hi('rubyCurlyBlockDelimiter', s:oc['gray'][2], '')
372+
call s:Hi('rubyInterpolationDelimiter', s:oc['orange'][4], '')
373+
" ARGV, $stdout
374+
call s:Hi('rubyPredefinedIdentifier', s:oc['red'][5], '')
375+
else
376+
" :help group-name
377+
" :help highlight-groups
378+
call s:Hi('Normal', s:oc['gray'][8], s:oc['gray'][1])
379+
call s:Hi('LineNr', s:oc['gray'][6], '')
380+
call s:Hi('Visual', '', s:oc['gray'][2])
381+
call s:Hi('VisualNOS', '', s:oc['gray'][2])
382+
383+
" Comment
384+
call s:Hi('Comment', s:oc['gray'][6], '')
385+
386+
" Constant
387+
call s:Hi('Constant', s:oc['yellow'][8], '')
388+
call s:Hi('String', s:oc['lime'][8], '')
389+
call s:Hi('Character', s:oc['orange'][7], '')
390+
call s:Hi('Number', s:oc['orange'][7], '')
391+
call s:Hi('Boolean', s:oc['orange'][7], '')
392+
call s:Hi('Float', s:oc['orange'][7], '')
393+
394+
" Identifier
395+
call s:Hi('Identifier', s:oc['yellow'][7], '')
396+
397+
" Statement
398+
call s:Hi('Statement', s:oc['violet'][6], '')
399+
call s:Hi('Conditional', s:oc['indigo'][5], '')
400+
call s:Hi('Repeat', s:oc['indigo'][5], '')
401+
call s:Hi('Operator', s:oc['cyan'][5], '')
402+
403+
" PreProc
404+
call s:Hi('PreProc', s:oc['violet'][6], '')
405+
406+
" Type
407+
call s:Hi('Type', s:oc['cyan'][5], '')
408+
409+
" Special
410+
call s:Hi('Special', s:oc['yellow'][7], '')
411+
call s:Hi('Delimiter', s:oc['gray'][8], '')
412+
call s:Hi('StringDelimiter', s:oc['gray'][8], '')
413+
414+
" Underlined
415+
call s:Hi('Underlined', s:oc['cyan'][5], '')
416+
417+
" Error
418+
call s:Hi('Error', s:oc['gray'][8], s:oc['red'][5])
419+
420+
" Todo
421+
call s:Hi('Todo', s:oc['gray'][9], s:oc['lime'][4])
422+
423+
" set textwidth=80 colorcolumn+=1
424+
call s:Hi('ColorColumn', '', s:oc['gray'][0])
425+
426+
" set cursorline
427+
call s:Hi('CursorLine', '', s:oc['gray'][0])
428+
call s:Hi('CursorLineNr', s:oc['yellow'][7], s:oc['gray'][0])
429+
" set cursorcolumn
430+
call s:Hi('CursorColumn', '', s:oc['gray'][9])
431+
highlight CursorLine cterm=NONE
432+
highlight CursorLineNr cterm=NONE
433+
434+
call s:Hi('Directory', s:oc['indigo'][5], '')
435+
436+
call s:Hi('DiffAdd', 'NONE', s:oc['lime'][3])
437+
call s:Hi('DiffDelete', 'NONE', s:oc['red'][5])
438+
call s:Hi('DiffChange', 'NONE', s:oc['indigo'][2])
439+
call s:Hi('DiffText', 'NONE', s:oc['cyan'][1])
440+
call s:Hi('diffAdded', s:oc['lime'][8], '')
441+
call s:Hi('diffRemoved', s:oc['red'][5], '')
442+
443+
call s:Hi('VertSplit', s:oc['gray'][3], s:oc['gray'][3])
444+
445+
call s:Hi('Folded', s:oc['gray'][6], s:oc['gray'][1])
446+
" set foldcolumn=1
447+
call s:Hi('FoldColumn', s:oc['gray'][6], s:oc['gray'][1])
448+
call s:Hi('MatchParen', '', s:oc['gray'][3])
449+
450+
" -- INSERT --
451+
call s:Hi('ModeMsg', s:oc['gray'][8], '')
452+
call s:Hi('MoreMsg', s:oc['lime'][8], '')
453+
" Search hit bottom
454+
call s:Hi('WarningMsg', s:oc['red'][5], '')
455+
456+
" let &showbreak = '> '
457+
call s:Hi('NonText', s:oc['gray'][6], '')
458+
459+
" Popup menu
460+
call s:Hi('Pmenu', s:oc['gray'][8], s:oc['gray'][2])
461+
call s:Hi('PmenuSel', s:oc['gray'][2], s:oc['gray'][6])
462+
call s:Hi('PmenuSbar', '', s:oc['gray'][3])
463+
call s:Hi('PmenuThumb', '', s:oc['gray'][8])
464+
465+
call s:Hi('Search', s:oc['gray'][9], s:oc['yellow'][2])
466+
" call s:Hi('IncSearch', '', '')
467+
468+
" :map, listchars
469+
call s:Hi('SpecialKey', s:oc['gray'][6], '')
470+
471+
call s:Hi('StatusLine', s:oc['gray'][3], s:oc['lime'][8])
472+
call s:Hi('StatusLineNC', s:oc['gray'][3], s:oc['gray'][6])
473+
call s:Hi('TabLineFill', s:oc['gray'][1], '')
474+
call s:Hi('TabLineSel', s:oc['gray'][1], s:oc['gray'][6])
475+
call s:Hi('TabLine', s:oc['gray'][6], s:oc['gray'][2])
476+
call s:Hi('WildMenu', s:oc['gray'][1], s:oc['lime'][8])
477+
478+
" :set all
479+
call s:Hi('Title', s:oc['indigo'][5], '')
480+
481+
call s:Hi('Conceal', s:oc['gray'][6], s:oc['gray'][2])
482+
call s:Hi('Ignore', s:oc['gray'][6], s:oc['gray'][1])
483+
484+
" vim-gitgutter
485+
call s:Hi('GitGutterAdd', s:oc['lime'][8], '')
486+
call s:Hi('GitGutterChange', s:oc['yellow'][7], '')
487+
call s:Hi('GitGutterDelete', s:oc['red'][7], '')
488+
call s:Hi('GitGutterChangeDelete', s:oc['yellow'][7], '')
489+
490+
" vim-ruby
491+
call s:Hi('rubyClass', s:oc['violet'][6], '')
492+
call s:Hi('rubyRegexp', s:oc['lime'][8], '')
493+
call s:Hi('rubyRegexpDelimiter', s:oc['lime'][8], '')
494+
call s:Hi('rubyArrayDelimiter', s:oc['gray'][8], '')
495+
call s:Hi('rubyBlockParameterList', s:oc['gray'][8], '')
496+
call s:Hi('rubyCurlyBlockDelimiter', s:oc['gray'][8], '')
497+
call s:Hi('rubyInterpolationDelimiter', s:oc['orange'][6], '')
498+
" ARGV, $stdout
499+
call s:Hi('rubyPredefinedIdentifier', s:oc['red'][5], '')
500+
endif
372501
endif
373502

374503
let g:colors_name = 'open-color'
375-
let &background = 'dark'
504+
let &background = s:background
376505

377506
let &cpo = s:save_cpo
378507
unlet s:save_cpo

0 commit comments

Comments
 (0)