feat(util): get hl color

This commit is contained in:
Folke Lemaitre 2024-11-21 22:10:10 +01:00
parent 017707955f
commit b0da066536
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -26,6 +26,14 @@ function M.set_hl(groups, opts)
end
end
---@param group string
---@param prop? string
function M.color(group, prop)
prop = prop or "fg"
local hl = vim.api.nvim_get_hl(0, { name = group, link = false })
return hl[prop] and string.format("#%06x", hl[prop])
end
---@param win number
---@param wo vim.wo
function M.wo(win, wo)