37 lines
768 B
Lua
37 lines
768 B
Lua
local palette = require("astrobox.palette")
|
|
local highlights = require("astrobox.highlights")
|
|
|
|
local default_cfg = {
|
|
contrast = "default", -- soft, default or hard
|
|
overrides = {}
|
|
}
|
|
|
|
local M = {
|
|
cfg = {},
|
|
palette = {},
|
|
hl = {},
|
|
}
|
|
|
|
function M.setup(user_cfg)
|
|
M.cfg = user_cfg
|
|
end
|
|
|
|
function M.set_highlights(list)
|
|
for hl, def in pairs(list) do
|
|
vim.api.nvim_set_hl(0, hl, def)
|
|
end
|
|
end
|
|
|
|
function M.load()
|
|
local cfg = vim.tbl_extend("force", default_cfg, M.cfg or {})
|
|
M.palette = palette(cfg)
|
|
M.hl = highlights(M.palette, cfg)
|
|
for index, color in ipairs(M.palette.term_colors) do
|
|
vim.g["terminal_color_" .. index - 1] = color
|
|
end
|
|
vim.g.colors_name = "astrobox"
|
|
M.set_highlights(M.hl)
|
|
end
|
|
|
|
return M
|