Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support change background according to the 'background' option #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
Plug 'ayu-theme/ayu-vim' " or other package manager
"...
set termguicolors " enable true colors support
let ayucolor="light" " for light version of theme

set background=light " for light version of theme

set background=dark " for mirage or dark version of theme
let ayucolor="mirage" " for mirage version of theme
let ayucolor="dark" " for dark version of theme

colorscheme ayu
```

Expand Down
2 changes: 1 addition & 1 deletion autoload/airline/themes/ayu.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
" Let's store all the colors in a dictionary.
let s:c = {}

let s:ayucolor = get(g:, 'ayucolor', 'dark')
let s:ayucolor = &background ==# 'dark' ? get(g:, 'ayucolor', 'dark') : &background

if s:ayucolor == 'light'
" Base colors.
Expand Down
2 changes: 1 addition & 1 deletion autoload/lightline/colorscheme/ayu.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let s:style = get(g:, 'ayucolor', 'dark')
let s:style = &background ==# 'dark' ? get(g:, 'ayucolor', 'dark') : &background

let s:fg = {}
let s:fg.primary = {'dark': '#E6E1CF', 'light': '#5C6773', 'mirage': '#D9D7CE'}[s:style]
Expand Down
8 changes: 1 addition & 7 deletions colors/ayu.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if exists("syntax_on")
syntax reset
endif

let s:style = get(g:, 'ayucolor', 'dark')
let s:style = &background ==# 'dark' ? get(g:, 'ayucolor', 'dark') : &background
let g:colors_name = "ayu"
"}}}

Expand Down Expand Up @@ -269,9 +269,3 @@ hi! link diffAdded String
" diffComment

"}}}
"
" This is needed for some reason: {{{

let &background = s:style

" }}}