diff --git a/lua/catppuccin/palettes/init.lua b/lua/catppuccin/palettes/init.lua index d022f9fb..6c199a3c 100644 --- a/lua/catppuccin/palettes/init.lua +++ b/lua/catppuccin/palettes/init.lua @@ -5,7 +5,18 @@ function M.get_palette(flavour) local _, palette = pcall(require, "catppuccin.palettes." .. flvr) local O = require("catppuccin").options local ans = vim.tbl_deep_extend("keep", O.color_overrides.all or {}, O.color_overrides[flvr] or {}, palette or {}) - if O.kitty and O.transparent_background then -- https://github.com/kovidgoyal/kitty/issues/2917 + + --[[ + Kitty makes Neovim transparent if its own terminal background matches Neovim, + so we need to adjust the color channels to make sure people don't suddenly + have a transparent background if they haven't specified it. + + Unfortunately, this currently means all users on Kitty will have all their + palette colors slightly offset. + + ref: https://github.com/kovidgoyal/kitty/issues/2917 + --]] + if O.kitty then for accent, hex in pairs(ans) do local red_green_string = hex:sub(1, 5) local blue_value = tonumber(hex:sub(6, 7), 16) @@ -15,6 +26,7 @@ function M.get_palette(flavour) ans[accent] = string.format("%s%.2x", red_green_string, blue_value) end end + return ans end