feat: ayu adaptive background (#584)

* feat: Enable adaptive theme for ayu theme

* Update description of ayu theme

* doc: make formatting consistent
This commit is contained in:
Michael Lan 2022-02-20 18:05:43 -08:00 committed by GitHub
parent 605a30f2fe
commit 016a20711e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -40,8 +40,11 @@ it'll try it's best to generate one.
</p> </p>
### ayu ### ayu
It's a combination of ayu_light, ayu_dark & ayu_mirage. It loads one of these It's a combination of ayu_light, ayu_dark & ayu_mirage. If `g:ayucolor` exists,
them based you your `g:ayucolor` option. it loads one of these based on your `g:ayucolor` option. Otherwise, it will
load ayu_light when background=light and ayu_dark when background=dark
But if `g:ayuprefermirage` exists, it will load ayu_mirage instead when
`background=dark`.
### codedark ### codedark
<p> <p>

View File

@ -2,6 +2,7 @@
-- MIT license, see LICENSE for more details. -- MIT license, see LICENSE for more details.
-- Credit: itchyny(lightline) -- Credit: itchyny(lightline)
-- License: MIT License -- License: MIT License
local style = vim.g.ayucolor or 'dark' local background = vim.opt.background:get()
local style = vim.g.ayucolor or ((background == 'dark') and vim.g.ayuprefermirage and 'mirage' or background)
return require('lualine.themes.ayu_' .. style) return require('lualine.themes.ayu_' .. style)