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

Lualine config does not use the custom colors set by 'on_colors' #100

Open
skamsie opened this issue Oct 7, 2024 · 2 comments
Open

Lualine config does not use the custom colors set by 'on_colors' #100

skamsie opened this issue Oct 7, 2024 · 2 comments

Comments

@skamsie
Copy link

skamsie commented Oct 7, 2024

Not sure if this is the intended behavior here, but I expected the colors set via on_colors option would override the corresponding color globally, however it's not applied for lualine. Please see the following example:

-- ~/.config/nvim/lua/plugins/solarized.lua
return {
  'maxmx03/solarized.nvim',
  enabled = true,
  lazy = false,
  priority = 1000,
  opts = {
    on_colors = function()
      -- setting to red just for exemplification purpose
      return { blue   = '#BD3613' }
    end,
  },

  config = function(_, opts)
    require('solarized').setup(opts)
    vim.cmd.colorscheme 'solarized'

    require('lualine').setup {
      options = {
        theme = require('lualine.themes.solarized')
      }
    }
  end
}

This change would replace everything that was normally blue originally with #BD3613 with the exception of the lualine which still shows the 'old blue' #268BD2

Screenshot 2024-10-07 at 18 39 14
@maxmx03
Copy link
Owner

maxmx03 commented Oct 8, 2024

You can't use on_colors to override Lualine's colors. Click here to see an example of how to customize it.

@skamsie
Copy link
Author

skamsie commented Oct 9, 2024

@maxmx03 thanks but you are basically suggesting to start writing the whole lualine theme from scratch 😅. As far as I know if I change only one field, eg normal = { a = { fg = colors.base04, bg = colors.blue }, } then I have to update the others as well b = ..., c =... and for the other modes. I was hoping that I can only overwrite lualine_a_normal but it does not work

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

2 participants