Skip to content

Commit

Permalink
feat: add workaround for kitty transparent issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nullchilly committed Sep 2, 2023
1 parent 2e3e5eb commit 519062a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ require("catppuccin").setup({
transparent_background = false, -- disables setting the background color.
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
kitty = false, -- workaround for kitty transparent issue: https://github.com/kovidgoyal/kitty/issues/2917
dim_inactive = {
enabled = false, -- dims the background color of inactive window
shade = "dark",
Expand Down
1 change: 1 addition & 0 deletions doc/catppuccin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ options and settings.
transparent_background = false, -- disables setting the background color.
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
kitty = false, -- workaround for kitty transparent issue: https://github.com/kovidgoyal/kitty/issues/2917
dim_inactive = {
enabled = false, -- dims the background color of inactive window
shade = "dark",
Expand Down
9 changes: 9 additions & 0 deletions lua/catppuccin/groups/integrations/ufo.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
local M = {}

M.get = function()
return {
UfoFoldedFg = { fg = C.lavender },
}
end

return M
1 change: 1 addition & 0 deletions lua/catppuccin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ local M = {
transparent_background = false,
show_end_of_buffer = false,
term_colors = false,
kitty = false,
dim_inactive = {
enabled = false,
shade = "dark",
Expand Down
10 changes: 9 additions & 1 deletion lua/catppuccin/palettes/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ function M.get_palette(flavour)
local flvr = flavour or require("catppuccin").flavour or vim.g.catppuccin_flavour or "mocha"
local _, palette = pcall(require, "catppuccin.palettes." .. flvr)
local O = require("catppuccin").options
return vim.tbl_deep_extend("keep", O.color_overrides.all or {}, O.color_overrides[flvr] or {}, palette or {})
local ans = vim.tbl_deep_extend("keep", O.color_overrides.all or {}, O.color_overrides[flvr] or {}, palette or {})
if O.kitty then
for accent, hex in pairs(ans) do
local int = hex:gsub("#", "0x")
int = tonumber(int)
ans[accent] = string.format("#%.6x", int == 16777215 and int - 1 or int + 1)
end
end
return ans
end

return M

0 comments on commit 519062a

Please sign in to comment.