Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong color shown when using color_overrides in Kitty #657

Closed
jerboa88 opened this issue Feb 13, 2024 · 0 comments · Fixed by #644
Closed

Wrong color shown when using color_overrides in Kitty #657

jerboa88 opened this issue Feb 13, 2024 · 0 comments · Fixed by #644
Labels
bug Something isn't working

Comments

@jerboa88
Copy link
Contributor

jerboa88 commented Feb 13, 2024

Description

When using kitty terminal, certain colors added to the color_overrides config section are shown incorrectly. For example, setting text = "#dedeff" results in yellow text being shown.

Cause: The workaround for kitty transparency implementation in lua/catppuccin/palettes/init.lua treats the input color as a single integer, and incrementing this integer can cause the green and blue channels to roll over to 0 if they are already at max brightness.

Neovim version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1692716794

Terminal and multiplexer

kitty 0.32.1

Catppuccin version / branch / rev

main

Steps to reproduce

  1. Run nvim -u repro.lua in kitty terminal
  2. Observe the text color is yellow, rather than white

Expected behavior

Displayed colors should match what is defined in color_overrides

Actual behavior

Displayed colors are incorrect when defining colors in color_overrides that end in ff or ffff

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
	{
		"catppuccin/nvim",
		name = "catppuccin",
		opts = {
			color_overrides = {
				all = {
					text = "#dedeff", -- This will be displayed incorrectly as #dede00
					-- text = "#dedefe", -- This will be displayed correctly as #dedeff
				}
			}
		},
	},
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

vim.cmd.colorscheme("catppuccin")
-- add anything else here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant