Closed is0n closed 2 years ago
Heyyo @is0n, Have you tried with vim.api.nvim_get_hl_by_name(hl_name, true)
? 🤔
local ExtractHl = function(hl)
local nice = vim.api.nvim_get_hl_by_name(hl, true)
return ("#%06x"):format(nice.foreground or 0)
end
vim.api.nvim_get_hl_by_name(hl_name, true)
works great! This fixes the config from returning an error when a highlight group is linked
but not when it does not exist
. At that point however, I think it would make sense to fallback
on the current default
colors right?
Ah yes, setting fallback colors instead of hardcoding makes sense. Will change when i get some free time 😅
Heyyo @is0n , I have pushed the fallback feature to main, let me know if it works when you have time.
It works perfectly and looks so nice!
Thanks again for your amazing work! 👍🏽
The default
mode_colors
setting uses colors that don't work well with certain color schemes. I think that it would be better ifstaline-nvim
would (by default) use colors based on the current color scheme instead of being hardcoded (kind of relates to #26).I've gotten something like this to work with the following:
This isn't perfect as
ExtractHl
will break if a highlight group does notexist
or islinked
to another group but it can definitely can be improved upon :D