support overriding colors using vim.g.catppuccin_override_colors

dev
anon 2 years ago
parent ffd6f3e104
commit fb2a69c7ff

@ -3,10 +3,20 @@ local M = {}
function M.get_palette()
local flvr = vim.g.catppuccin_flavour
local palette = require("catppuccin.core.palettes.mocha")
if flvr == "mocha" or flvr == "latte" or flvr == "macchiato" or flvr == "frappe" then
return require("catppuccin.core.palettes." .. flvr)
palette = require("catppuccin.core.palettes." .. flvr)
end
return require("catppuccin.core.palettes.mocha")
if type(vim.g.catppuccin_override_colors) == "table" then
for k, v in pairs(vim.g.catppuccin_override_colors) do
if palette[k] then
palette[k] = v
end
end
end
return palette
end
return M

Loading…
Cancel
Save