Skip to content

Commit

Permalink
revert: fix(kitty): respect transparent_background option (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoudham authored Oct 28, 2024
1 parent 9970917 commit 65bf0b1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lua/catppuccin/palettes/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down

0 comments on commit 65bf0b1

Please sign in to comment.