diff --git a/THEMES.md b/THEMES.md index 2cc3a9c..917b517 100644 --- a/THEMES.md +++ b/THEMES.md @@ -40,8 +40,11 @@ it'll try it's best to generate one.

### ayu -It's a combination of ayu_light, ayu_dark & ayu_mirage. It loads one of these -them based you your `g:ayucolor` option. +It's a combination of ayu_light, ayu_dark & ayu_mirage. If `g:ayucolor` exists, +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

diff --git a/lua/lualine/themes/ayu.lua b/lua/lualine/themes/ayu.lua index 380e3a4..b784306 100644 --- a/lua/lualine/themes/ayu.lua +++ b/lua/lualine/themes/ayu.lua @@ -2,6 +2,7 @@ -- MIT license, see LICENSE for more details. -- Credit: itchyny(lightline) -- 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)