Merge branch 'main' into dev

dev
Pocco81 2 years ago
commit 8b707ee660

@ -322,6 +322,18 @@ local colors = require'catppuccin.api.colors'.get_colors() -- fetch colors with
catppuccin.remap({ Comment = { fg = colors.flamingo }, })
```
#### Overwriting colors
Colors can be overwritten using `vim.g.catppucin_override_colors`:
```lua
vim.g.catppuccin_override_colors = {
base = "#ff0000",
mantle = "#242424",
crust = "#474747",
}
```
#### Hooks
Use them to execute code at certain events. These are the ones available:

@ -77,6 +77,7 @@ config.options = {
telekasten = true,
symbols_outline = true,
},
color_overrides = {}
custom_highlights = {},
}

@ -1,12 +1,34 @@
local M = {}
local cnf = require("catppuccin.config").options
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
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
vim.api.nvim_echo(
{ { 'Warning: "' .. k .. '" is not a valid catppucin palette color.', "WarningMsg" } },
true,
{}
)
end
end
end
end
end
return require("catppuccin.core.palettes.mocha")
return palette
end
return M

Loading…
Cancel
Save