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

consider using blend opt of vim.api.nvim_set_hl() instead of alpha_blend() #251

Closed
tmillr opened this issue May 11, 2023 · 3 comments
Closed

Comments

@tmillr
Copy link
Member

tmillr commented May 11, 2023

Why?

  1. It's builtin to Neovim.

  2. It may handle blending with different background colors dynamically (although this needs further investigation). For example, it seems that the current use of alpha_blend() always assumes the bg to be the global/default bg for the current theme for any given hl group and position on the screen? But that is not necessarily always the case (a hl group may have bg set and set to a different color, there may be extmarks setting the bg color arbitrarily at runtime, the highlight could be appearing in a floating window which has a different bg than the default/global, etc. My point is that it might be that Neovim's blend option for vim.api.nvim_set_hl() handles all of these cases of blending with arbitrary bg colors dynamically at runtime - although I am not totally sure of this and it needs further investigation; it could be that it only considers the bg setting for just that one, single hl group specified to set_hl()).

@ful1e5
Copy link
Member

ful1e5 commented May 12, 2023

@tmillr I intentionally used alpha_blend to make sure the colors and names in the primer palettes match exactly with this colorscheme.

Even though the blend option is available, I think it's not working right now because the compiler module uses a Vim command and string concatenation to set highlights. However, I plan to add the blend option to the groups overrides, so that users can benefit from this cool feature.

@tmillr
Copy link
Member Author

tmillr commented Jul 28, 2023

I apologize if my original post is confusing. When I posted this I didn't understand blend too well. After playing around with it and trying to read up on it, I think it only really works in floating windows, I'm not sure. But it doesn't seem to work in the way that I thought it could (e.g. by being able to automatically blend any highlights/highlight groups appearing within a normal window with the background of that window just by changing the blend attribute of a hl group).

@ful1e5
Copy link
Member

ful1e5 commented Jul 30, 2023

I apologize if my original post is confusing. When I posted this, I didn't understand blend too well. After playing around with it and trying to read up on it, I think it only really works in floating windows, but I'm not sure. It doesn't seem to work in the way that I thought it could (e.g., by being able to automatically blend any highlights/highlight groups appearing within a normal window with the background of that window just by changing the blend attribute of an hl group).

No worries!

@tmillr Since some Neovim plugins use the blend feature, it's a nice addition for users to customize popup window highlights in those plugins. However, this feature is not supported in nightfox, as it is a Neovim-only feature.

BTW, Thank you for reporting, contributing, and sponsoring this project. Your efforts are appreciated!

I'm closing this issue as complete, and it can be reopened in the future for further discussion.

@ful1e5 ful1e5 closed this as completed Jul 30, 2023
ful1e5 added a commit that referenced this issue Jul 30, 2023
Added logs about #251, #289, #285 in CHANGELOG.md
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