xonecas.io
314
Vc

vim-colors-256 / files

vim-colors-256 / colors / seoul256-light.vim

2.8 KB
1" "  _____             _ ___ ___ ___            "
2" " |   __|___ ___ _ _| |_  |  _|  _|           "
3" " |__   | -_| . | | | |  _|_  | . |           "
4" " |_____|___|___|___|_|___|___|___|-light.vim "
5"
6" " Low-contrast light Vim color scheme using Seoul Colors "
7"
8" File:         seoul256-light.vim
9" URL:          github.com/junegunn/seoul256.vim
10" Author:       Junegunn Choi (junegunn.c@gmail.com)
11" Version:      1.4.0
12" Last Updated: July 6, 2014
13" License:      MIT
14"
15" Copyright (c) 2013 Junegunn Choi
16"
17" MIT License
18"
19" Permission is hereby granted, free of charge, to any person obtaining
20" a copy of this software and associated documentation files (the
21" "Software"), to deal in the Software without restriction, including
22" without limitation the rights to use, copy, modify, merge, publish,
23" distribute, sublicense, and/or sell copies of the Software, and to
24" permit persons to whom the Software is furnished to do so, subject to
25" the following conditions:
26"
27" The above copyright notice and this permission notice shall be
28" included in all copies or substantial portions of the Software.
29"
30" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37
38let s:master    = get(split(globpath(&rtp, 'colors/seoul256.vim'), '\n'), 0, '')
39let s:custom_bg = get(g:, 'seoul256_light_background', get(g:, 'seoul256_background', 253))
40let s:light     = s:custom_bg >= 252 && s:custom_bg <= 256
41let s:var_found = exists('g:seoul256_background')
42let s:light_var_found = exists('g:seoul256_light_background')
43
44if !empty(s:master)
45  try
46    " Backup current g:seoul256_background
47    if s:var_found
48      let s:backup = g:seoul256_background
49    endif
50
51    " Invalid range. Force the default light version.
52    if !s:light && s:var_found
53      unlet g:seoul256_background
54    endif
55
56    " g:seoul256_light_background is found, use it
57    if s:light && s:light_var_found
58      let g:seoul256_background = s:custom_bg
59    endif
60
61    if get(g:, 'colors_name', '') == 'seoul256-light' && &background == 'dark'
62      set background=dark
63    else
64      set background=light
65    endif
66    let g:colors_name = 'seoul256'
67    execute 'silent source '.s:master
68    let g:colors_name = &background == 'dark' ? 'seoul256' : 'seoul256-light'
69  finally
70    " Revert g:seoul256_background
71    if s:var_found
72      let g:seoul256_background = s:backup
73    endif
74  endtry
75else
76  echom 'seoul256.vim not found'
77endif
78