mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-06 19:58:22 +00:00
feat(util): get hl color
This commit is contained in:
parent
017707955f
commit
b0da066536
1 changed files with 8 additions and 0 deletions
|
@ -26,6 +26,14 @@ function M.set_hl(groups, opts)
|
||||||
end
|
end
|
||||||
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 win number
|
||||||
---@param wo vim.wo
|
---@param wo vim.wo
|
||||||
function M.wo(win, wo)
|
function M.wo(win, wo)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue