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

Override highlight groups by multiple colors of base46 #2827

Closed
AstrickHarren opened this issue May 8, 2024 · 4 comments
Closed

Override highlight groups by multiple colors of base46 #2827

AstrickHarren opened this issue May 8, 2024 · 4 comments

Comments

@AstrickHarren
Copy link

Is your feature request related to a problem? Please describe.
I want to override the hl groups DiffAdd to furnish a greenish bg and no fg. The green bg should vary
depending on if the theme is light or dark. My approach is to calculate the luminance of the Normal (or base30.black)
color group and decide the current theme type.

Describe the solution you'd like
This require me to take in more than one color from base30 as an input calculate DiffAdd

Describe alternatives you've considered
It could also be useful to have a user-defined event under theme switch by base46 (which I have not found yet)

@siduck
Copy link
Member

siduck commented May 8, 2024

@siduck siduck closed this as completed May 8, 2024
@AstrickHarren
Copy link
Author

For those who are interested in how to change diffview colors based on theme type, I was able to do this with an autocmd on BufEnter the diffview buffers that changes the highlight groups dynamically with base46's type.

There may be a more natural way to do this, perhaps customizing a theme integration like one in the base46.integration dir is most satisfying, but I was unable to figure out how even after reading related documentations and source codes.

@AstrickHarren
Copy link
Author

02:56:10PM@May_08_2024 grim
02:55:51PM@May_08_2024 grim

@siduck
Copy link
Member

siduck commented May 8, 2024

why dynamically tho? most use red for diffremoved, green for added. So just use hl_override!

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