2022-09-05 12:06:03 +00:00
local M = { }
2021-04-19 12:39:35 +00:00
2022-09-03 21:47:25 +00:00
---@class Config
2022-09-12 05:51:08 +00:00
---@field on_colors fun(colors: ColorScheme)
---@field on_highlights fun(highlights: Highlights, colors: ColorScheme)
2022-09-05 12:06:03 +00:00
local defaults = {
2022-09-05 18:32:31 +00:00
style = " storm " , -- The theme comes in three styles, `storm`, a darker variant `night` and `day`
transparent = false , -- Enable this to disable setting the background color
2022-09-05 20:12:25 +00:00
terminal_colors = true , -- Configure the colors used when opening a `:terminal` in Neovim
2022-09-05 12:06:03 +00:00
styles = {
2022-09-05 18:32:31 +00:00
-- Style to be applied to different syntax groups
2022-09-12 05:51:08 +00:00
-- Value is any valid attr-list value for `:help nvim_set_hl`
comments = { italic = true } ,
keywords = { italic = true } ,
functions = { } ,
variables = { } ,
2022-09-05 18:32:31 +00:00
-- Background styles. Can be "dark", "transparent" or "normal"
sidebars = " dark " , -- style for sidebars, see below
floats = " dark " , -- style for floating windows
2022-09-05 12:06:03 +00:00
} ,
2022-09-05 20:12:25 +00:00
sidebars = { " qf " , " help " } , -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
day_brightness = 0.3 , -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
hide_inactive_statusline = false , -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
2022-09-05 21:10:59 +00:00
dim_inactive = false , -- dims inactive windows
2022-09-05 20:12:25 +00:00
lualine_bold = false , -- When `true`, section headers in the lualine theme will be bold
2022-09-05 18:32:31 +00:00
2022-09-05 20:12:25 +00:00
--- You can override specific color groups to use other groups or a hex color
2022-09-05 18:32:31 +00:00
--- fucntion will be called with a ColorScheme table
---@param colors ColorScheme
on_colors = function ( colors ) end ,
2022-09-05 20:12:25 +00:00
--- You can override specific highlights to use other groups or a hex color
2022-09-05 18:32:31 +00:00
--- fucntion will be called with a Highlights and ColorScheme table
---@param highlights Highlights
---@param colors ColorScheme
on_highlights = function ( highlights , colors ) end ,
2022-09-10 07:35:41 +00:00
use_background = true , -- can be light/dark/auto. When auto, background will be set to vim.o.background
2021-04-19 12:39:35 +00:00
}
2021-04-17 19:22:55 +00:00
2022-09-05 12:06:03 +00:00
---@type Config
M.options = { }
2022-09-05 14:56:58 +00:00
---@param options Config|nil
2022-09-05 12:06:03 +00:00
function M . setup ( options )
M.options = vim.tbl_deep_extend ( " force " , { } , defaults , options or { } )
2021-05-12 09:19:28 +00:00
end
2021-04-25 13:50:02 +00:00
2022-09-05 14:56:58 +00:00
---@param options Config|nil
2022-09-05 14:09:28 +00:00
function M . extend ( options )
M.options = vim.tbl_deep_extend ( " force " , { } , M.options or defaults , options or { } )
end
2022-09-10 07:35:41 +00:00
function M . is_day ( )
return M.options . style == " day " or M.options . use_background and vim.o . background == " light "
end
2022-09-05 12:06:03 +00:00
M.setup ( )
return M