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

fix: wrong color shown when using color_overrides #658

Merged
merged 1 commit into from
Feb 14, 2024
Merged

fix: wrong color shown when using color_overrides #658

merged 1 commit into from
Feb 14, 2024

Conversation

jerboa88
Copy link
Contributor

Fix for #657 (Wrong color shown when using color_overrides in Kitty).

Rewrote this section of code to increment or decrement just the blue channel instead of treating color as a single number.

@mrtnvgr
Copy link
Contributor

mrtnvgr commented Feb 13, 2024

This does not work for me

20240213_09h43m27s_grim

-- 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 = {
	{
		"jerboa88/catppuccin-nvim",
		branch = "wrong-color-shown-when-using-color_overrides",
		name = "catppuccin",
		opts = {
			color_overrides = {
				all = {
					text = "#dedeff", -- This will displayed incorrectly as #dede00
					-- text = "#dedefe", -- This will displayed correctly as #dedefe
				}
			}
		},
	},
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

vim.cmd.colorscheme("catppuccin")
-- add anything else here

@jerboa88
Copy link
Contributor Author

@mrtnvgr I think lazy is still using a cached version of catppuccin/nvim in your case.

After running repro.lua from #657, I had to delete the .repro directory so that lazy.nvim will pull it again from my repo. After that, running nvim -u repro.lua with your repro.lua works as expected.

Copy link
Contributor

@nullchilly nullchilly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use github cli and testing this PR is as simple as gh pr checkout 658 inside catppuccin git folder

#dedefe #dedeff

Before

image

image

After

image

image

Thanks for the PR!

@nullchilly nullchilly merged commit b76ada8 into catppuccin:main Feb 14, 2024
9 checks passed
@jerboa88 jerboa88 deleted the wrong-color-shown-when-using-color_overrides branch February 14, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants