Refacto palette and theme, added more colors

This commit is contained in:
2024-02-18 16:46:13 +01:00
parent 8a91acbe19
commit e4cfb6ebd0
15 changed files with 431 additions and 240 deletions

View File

@@ -1,9 +1,14 @@
local utils = require("astrobox.utils")
return function(palette, config)
local M = {}
--- @param theme Theme
--- @param palette Palette
--- @param config Config
function M.make_highlights(theme, palette, config)
local HL = {}
local function load_mod(mod, mod_name)
local ok, res = pcall(mod, palette, config)
local ok, res = pcall(mod, theme, palette, config)
if ok and res then
HL = vim.tbl_extend("error", HL, res)
else
@@ -12,7 +17,7 @@ return function(palette, config)
end
utils.visit_astrobox_modules("highlights.modules", load_mod)
HL = vim.tbl_extend("force", HL, config.overrides)
return HL
end
return M