Now standalone plugin

First impl of standalone colorscheme
This commit is contained in:
2023-12-09 23:20:15 +01:00
parent c889771241
commit b4d05200d3
12 changed files with 633 additions and 124 deletions

36
lua/astrobox/init.lua Normal file
View File

@@ -0,0 +1,36 @@
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