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

bug: reload colors #327

Open
juanolon opened this issue Nov 25, 2024 · 0 comments
Open

bug: reload colors #327

juanolon opened this issue Nov 25, 2024 · 0 comments
Labels

Comments

@juanolon
Copy link

Neovim version (nvim -v)

NVIM v0.10.0

Terminal / multiplexer

Kitty

Describe the bug

I've done a custom theme for lualine similar to the original rose-pine them:

local colors = require("rose-pine.palette")

local pine = {
    normal = {
        a = { bg = colors.overlay, fg = colors.rose, gui = "bold" },
        b = { bg = colors.overlay, fg = colors.rose },
        c = { bg = colors.base, fg = colors.text },
    },
}

and then later, i set the them to lualine like

        opts = {
            options = {
                theme = pine,
...

It works as expected, by whenever i change the background (light/dark), the colors don't update to the corresponding dark/light colors.

I did the same for tabby, but I don't use the colors directly, instead, I use the hl names. like:

local theme = {
    current = 'TabLineSel',
    not_current = 'TabLine',
    fill = 'TabLineFill',
}

and change the hl colors on the rose-pine setup:

                highlight_groups = {
                    TabLineSel = { fg = 'rose', bg = 'surface' },

This way, the 'rose' name takes the correct color when switching the background.

Is there a way to get the colors, which respect the current background setting?
And if not, how can I make a custom lualine theme using the rose-pine colors?

Thanks!

Repro

vim.o.packpath = "/tmp/nvim/site"

local plugins = {
  rose_pine = "https://github.com/rose-pine/neovim",
  -- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
}

for name, url in pairs(plugins) do
  local install_path = "/tmp/nvim/site/pack/test/start/" .. name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system({ "git", "clone", "--depth=1", url, install_path })
  end
end

require("rose-pine").setup({
  -- ADD ROSÉ PINE CONFIG THAT IS _NECESSARY_ TO REPRODUCE THE ISSUE
})

vim.cmd("colorscheme rose-pine")
@juanolon juanolon added the bug label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant