nested & NONE colors override added (#84)
This commit is contained in:
@@ -245,22 +245,27 @@ end
|
||||
function util.color_overrides(colors, config)
|
||||
if type(config.colors) == "table" then
|
||||
for key, value in pairs(config.colors) do
|
||||
if not colors[key] then
|
||||
error("Color " .. key .. " does not exist")
|
||||
end
|
||||
if string.sub(value, 1, 1) == "#" then
|
||||
if not colors[key] then error("Color " .. key .. " does not exist") end
|
||||
|
||||
-- Patch: https://github.com/ful1e5/onedark.nvim/issues/6
|
||||
if type(colors[key]) == "table" then
|
||||
util.color_overrides(colors[key], { colors = value })
|
||||
else
|
||||
if value:lower() == "none" then
|
||||
-- set to none
|
||||
colors[key] = "NONE"
|
||||
elseif string.sub(value, 1, 1) == "#" then
|
||||
-- hex override
|
||||
colors[key] = value
|
||||
else
|
||||
-- another group
|
||||
if not colors[value] then
|
||||
error("Color " .. value .. " does not exist")
|
||||
end
|
||||
if not colors[value] then error("Color " .. value .. " does not exist") end
|
||||
colors[key] = colors[value]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function util.light(brightness)
|
||||
for hl_name, hl in pairs(vim.api.nvim__get_hl_defs(0)) do
|
||||
|
||||
Reference in New Issue
Block a user