From fb2a69c7fff1fa9afe4d101454802ca026ed16dd Mon Sep 17 00:00:00 2001 From: anon Date: Sun, 3 Jul 2022 15:29:53 +0300 Subject: [PATCH] support overriding colors using vim.g.catppuccin_override_colors --- lua/catppuccin/core/palettes/init.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lua/catppuccin/core/palettes/init.lua b/lua/catppuccin/core/palettes/init.lua index fc01b70..5d88f0c 100644 --- a/lua/catppuccin/core/palettes/init.lua +++ b/lua/catppuccin/core/palettes/init.lua @@ -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