mirror of https://github.com/sgoudham/nvim.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
748 B
Lua
32 lines
748 B
Lua
3 years ago
|
local M = {}
|
||
|
|
||
2 years ago
|
local cnf = require("catppuccin.config").options
|
||
2 years ago
|
local echo = require("catppuccin.utils.echo")
|
||
2 years ago
|
|
||
3 years ago
|
function M.get_palette()
|
||
|
local flvr = vim.g.catppuccin_flavour
|
||
|
|
||
2 years ago
|
local palette = require("catppuccin.palettes.mocha")
|
||
3 years ago
|
if flvr == "mocha" or flvr == "latte" or flvr == "macchiato" or flvr == "frappe" then
|
||
2 years ago
|
palette = require("catppuccin.palettes." .. flvr)
|
||
3 years ago
|
end
|
||
2 years ago
|
|
||
2 years ago
|
if type(cnf.color_overrides) == "table" then
|
||
|
for _, pal in pairs({"all", flvr}) do
|
||
|
if cnf.color_overrides[pal] ~= nil then
|
||
|
for k, v in pairs(cnf.color_overrides[pal]) do
|
||
|
if palette[k] then
|
||
|
palette[k] = v
|
||
|
else
|
||
2 years ago
|
echo('"'..k .. '" is not a valid catppucin palette color', "warn")
|
||
2 years ago
|
end
|
||
|
end
|
||
2 years ago
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return palette
|
||
3 years ago
|
end
|
||
|
|
||
|
return M
|