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

Suggestion: easier highlight group overriding #5

Open
raddari opened this issue Jul 1, 2023 · 4 comments
Open

Suggestion: easier highlight group overriding #5

raddari opened this issue Jul 1, 2023 · 4 comments

Comments

@raddari
Copy link

raddari commented Jul 1, 2023

Hi!
First of all, thank you for keeping this awesome colorscheme alive in modern Neovim, it looks fantastic!

I'm finding it a bit awkward to override highlight groups, however. For simplicity, I would like to be able to use your palette similar to other themes like tokyonight:

local c = require('gruber-darker.palette')
vim.api.nvim_set_hl(0, 'Cursor', { bg = c.wisteria })

but your current API requires me to do this instead:

local c = require('gruber-darker.palette')
vim.api.nvim_set_hl(0, 'Cursor', { bg = c.wisteria:to_string() })

Obviously this isn't a huge issue for overriding a few groups but it becomes quite cumbersome for setting lots of them - such as adding support for other plugins.

My current workaround looks something like this:

local c = setmetatable({}, {
  __index = function(_, k)
    return require('gruber-darker.palette')[k]:to_string()
  end,
})
vim.api.nvim_set_hl(0, 'Cursor', { bg = c.wisteria })

which is a bit hacky, but it works fine for my purposes.

I understand that this is very minor - it definitely doesn't detract from my experience using this colorscheme!
Cheers :)

@blazkowolf
Copy link
Owner

Thank you for your interest and excitement for the colorscheme! I'm glad you brought this up - a dedicated method for overriding colors in the plugin configuration is definitely lacking.

I'm going out of town today, so I will be unavailable for a few days, but when I'm back I will think on this. Thanks again for your valuable insight!

@muhayli
Copy link

muhayli commented Feb 12, 2024

Hello,
Could you please consider adding the override configuration?

@blazkowolf
Copy link
Owner

@mohiden I appreciate your eagerness for a good method of overriding colors. I'll try to get around to this eventually. I have been busy with work and not disciplined enough to sit down and work on this when I have other projects that are more interesting to me currently. Again, I will try to get to this, but I would greatly appreciate any PRs if you or anyone in the community gets to it before I do.

@muhayli
Copy link

muhayli commented Feb 12, 2024

Yeah sure, I am working on it, I'll make PR once finished.

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

No branches or pull requests

3 participants