docs: added more info on how to override colors and highlihgts

This commit is contained in:
Folke Lemaitre
2022-09-12 09:07:57 +02:00
parent c3507dee7e
commit 467ddc3a6e
6 changed files with 3903 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ function M.setup()
foot = "ini",
tilix = "json",
iterm = "itermcolors",
lua = "lua",
}
-- map of style to style name
local styles = {

View File

@@ -0,0 +1,28 @@
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local function deepcopy(tbl)
local ret = tbl
if type(tbl) == "table" then
ret = {}
for key, value in pairs(tbl) do
ret[key] = deepcopy(value)
end
end
return ret
end
colors = vim.deepcopy(colors)
colors._upstream_url = nil
colors._style_name = nil
local ret = "local colors = "
.. vim.inspect(colors)
.. "\n\nlocal highlights = "
.. vim.inspect(deepcopy(require("tokyonight.theme").setup().highlights))
.. "\n"
return ret
end
return M