Skip to content

How to set the bg color for a custom component? #700

Answered by fitrh
simonmclean asked this question in Q&A
Discussion options

You must be logged in to vote

:help lualine-General-component-options

The color option accept the following values

  • string as highlight group
  • table in the form { fg = number|string, bg = number|string, gui = string }
  • function that returns string or table as before

So if you want to define bg, you have to provide a hex string or a number

color = { bg = "#ff0000" }

If you want to use a specific highlight group, then the value must be a string

color = "DiagnosticError"

Each component have this structure

{
    function,
    color = {}, -- or string or number
    -- ...
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@simonmclean
Comment options

@fitrh
Comment options

@simonmclean
Comment options

Answer selected by simonmclean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants