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

Hard to read lualine inactive tabs #3

Closed
plague-doctor opened this issue Jun 22, 2024 · 2 comments
Closed

Hard to read lualine inactive tabs #3

plague-doctor opened this issue Jun 22, 2024 · 2 comments

Comments

@plague-doctor
Copy link

I'm attempting to understand the hues of your palette and subtly manipulate them to better suit my needs. Yet, I've encountered another issue I'm unable to resolve. The colour scheme in lualine makes the inactive tabs hard to read. Could you guide me on how to adjust this?

image

@sho-87
Copy link
Owner

sho-87 commented Jun 22, 2024

pushed out an update to increase the contrast a bit on those.

but to answer your question:

lualine is a bit of a special case because the colours for those are defined by a lualine theme. found here: https://github.com/sho-87/kanagawa-paper.nvim/blob/master/lua/lualine/themes/kanagawa-paper.lua

the inactive highlights are controlled by this block. a, b, and c are your regular lualine a,b,c sections:

kanagawa_paper.inactive = {
	a = { bg = theme.ui.bg_m3, fg = theme.ui.fg_gray },
	b = { bg = theme.ui.bg_m3, fg = theme.ui.fg_gray, gui = "bold" },
	c = { bg = theme.ui.bg_m3, fg = theme.ui.fg_gray },
}

so if you want to override those colours, you can create a custom theme based on the included theme, but assign different highlight groups to the sections you want. this is just the same as customizing a theme as per the lualine docs. For example, this will change the bg and fg of your a sections for inactive elements:

local M = {
  "nvim-lualine/lualine.nvim",
  opts = function()
    local kanagawa_paper = require("lualine.themes.kanagawa-paper")
    kanagawa_paper.inactive.a.fg = "#ff0000"
    kanagawa_paper.inactive.a.bg = "#ffffff"

    return {
      options = {
        theme = kanagawa_paper,
        ...
      }

Besides the special case of lualine, heres how you would adjust colours in general...

Lets say you want to change the bg colour of floating windows, which is defined in the theme file here. You have a couple of options:

Option 1: retarget the theme color

In your config for this plugin, you can set ui.float.bg to anything you want. That will change the colour for floating window backgrounds. Example:

return {
    "sho-87/kanagawa-paper.nvim",
    opts = {
      colors = {
        theme = {
          ui = {
            float = {
              bg = "#ff0000",
            },
          },
        },
      },
    },
  }

Option 2: retarget the palette color

This is more extreme. Notice that by default ui.float.bg is assigned to palette.sumiInk4. What you can do is redefine the value of palette.sumiInk4. This will change the value of the base colour, so any other place that uses sumiInk4 will also be changed:

return {
    "sho-87/kanagawa-paper.nvim",
    opts = {
      transparent = false,
      colors = {
        palette = {
          sumiInk4 = "#ff0000",
        },
      },
    },
  }

Note

If you use transparency mode, using either option above might not seem to do anything (especially in the case of bg colors). This is because of how transparency mode works, which just sets bg color to none. Transparency mode can be a bit finicky in general because of how different plugins do transparency

@plague-doctor
Copy link
Author

Perfect! Thank you kindly for elaborative explanation 🙏 Maybe next time I will be able to send a PR instead :-)

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