luisiacc / gruvbox-baby

Gruvbox theme for neovim with full 🎄TreeSitter support.
MIT License
402 stars 28 forks source link

The configuration of `transparent_mode` and `background_color` will only work one #56

Closed itaober closed 1 year ago

itaober commented 1 year ago

After looking the code, I found that the reason is that both of them work by set background and background_dark field, so if configured transparent_mode, background_color will not working.

So maybe background_color feature work by config foreground, and transparent_mode feature work by config background & background_dark?

  local background = config.background_color or colors.background
  if intensity_map[background] then
    colors = vim.tbl_extend("force", colors, intensity_map[background])
  end

  if config.transparent_mode then
    local transparent = {
      background = colors.none,
      background_dark = colors.none,
    }
    colors = vim.tbl_extend("force", colors, transparent)
  end

This is my config:

local g = vim.g

g.gruvbox_baby_background_color = "medium"
g.gruvbox_baby_function_style = "NONE"
g.gruvbox_baby_telescope_theme = 1
g.gruvbox_baby_transparent_mode = 1

vim.cmd([[colorscheme gruvbox-baby]])
luisiacc commented 1 year ago

Yes this happens because they both serve opposite goals.

transparent mode is meant to be used on terminals where you cannot set text_background_opacity, which means that there is no way to see a background in the terminal unless you remove the background from nvim, this is what transparent mode does, if you use a terminal that can use text background opacity or window opacity or something like that, you should not use transparent mode.

itaober commented 1 year ago

fine, thanks for your answer.