christopher-francisco / tmux-status.nvim

Get tmux status components for your statusline
MIT License
38 stars 0 forks source link

Background colour #4

Open djensenius opened 1 month ago

djensenius commented 1 month ago

Hello-

When using lualine the background colour doesn't match.

I made this change to make it work.

local M = {}
local utils = require("lualine.utils.utils")

---@param colors TmuxStatusComponentColors
function M.create_hightlights(colors)
  local lualine_bg = utils.extract_highlight_colors("statusline", "bg")
  for name, value in pairs(colors) do
    vim.cmd.highlight('tmux_status_' .. name .. ' guifg=' .. value .. ' guibg=' .. lualine_bg)
  end
end

---@param name string
---@return string
function M.get_highlight(name)
  return "%#" .. name .. "#"
end

return M
christopher-francisco commented 1 month ago

Nice one. Looks like you'd like the ability to set the BG color, so that it's retained. Perhaps this is better passed down in the config object. Do you mind sharing a couple of screenshots, 1 without the change above, and one with it?

djensenius commented 1 month ago

Sure thing!

Without: Image

With: Image

Using theme = "catppuccin" in lualine

christopher-francisco commented 1 month ago

Makes sense. Perhaps the way to go is expanding the properties in colors to take an object defining both fg and bg, as opposed to a string. Do you think that could work?

djensenius commented 1 month ago

That could work. :)