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

Allow combination of backgrounds with and without transparency #2318

Open
GNRSN opened this issue Jan 27, 2024 · 4 comments
Open

Allow combination of backgrounds with and without transparency #2318

GNRSN opened this issue Jan 27, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@GNRSN
Copy link

GNRSN commented Jan 27, 2024

Creating this as a separate issue following discussion in #2304

Is your feature request related to a problem? Please describe.
vim.g.neovide_transparency controls background transparency but setting it to 0 removes all backgrounds which will break any feature relying on bg to convey meaning. Some examples: Visual mode selection, cursorline/col, vim-illuminate, selection in menus, search result highlights, virtual cursor in UI plugins like Noice.

The best workaround at the moment is running with vim.g.neovide_transparency at some value > 0.5. This still results in bad contrast in my experience and results in only a semi transparent background.

Describe the solution you'd like
Some way to denote which highlight groups should have their backgrounds removed, IMO transparency should be opt in to avoid breaking UIs unknowingly.

Since neovide_background_color is now deprecated on main we'd preferably need some way to still achieve semi-translucent colors.

Additional context
I'm on macOS, all my experience is based on macOS usage

@GNRSN GNRSN added the enhancement New feature or request label Jan 27, 2024
@GNRSN
Copy link
Author

GNRSN commented Jan 27, 2024

My original comment mentioned that Alactitty has a config toggle for this explained as:

Whether or not window.opacity applies to all cell backgrounds, or only to
the default background. When set to true all cells will be transparent
regardless of their background color.

Maybe this can be of inspiration? I think that having only a single highlight group, e.g. Normal be translucent would be insufficient though.

I think the optimal solution would be to allow declaring transparency per hl group, e.g. by re-using the blend value when some neovide specific config is set, lets say vim.g.neovide_bgblend = true

@fredizzimo
Copy link
Member

We, don't need much additional support from Neovim for this. I will try to send a PR to them soon with the support we need, so it gets included in 0.10.0.

We also need a clarification what background None really should mean, if it's fully transparent or normal. I think only the latter can be implemented by GUIs ATM

I don' think we should do anything Neovide specific, unless it's something simple, like only apply it to Normal rather than all backgrounds.

@comfysage
Copy link

comfysage commented Mar 8, 2024

would it make sense to apply transparency to all hl groups sharing a bg color color with Normal.

so with a config like:

hi! Normal guibg=#1d2021
hi! StatusLine guibg=#2a2a2a
hi! TabLineFill guibg=#1d2021
let g:neovide_transparency = 0

Normal and TabLineFill will be fully transparent, while StatusLine will still show a bg color.

@fredizzimo
Copy link
Member

I created a proposal for dealing with global transparency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants