mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
refactor: move is_transparent to util
This commit is contained in:
parent
089ff668d2
commit
96ac87b6b1
2 changed files with 14 additions and 12 deletions
|
@ -110,4 +110,18 @@ function M.blend(fg, bg, alpha)
|
|||
return string.format("#%02x%02x%02x", blend(1), blend(2), blend(3))
|
||||
end
|
||||
|
||||
local transparent ---@type boolean?
|
||||
function M.is_transparent()
|
||||
if transparent == nil then
|
||||
transparent = M.color("Normal", "bg") == nil
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
group = vim.api.nvim_create_augroup("snacks_util_transparent", { clear = true }),
|
||||
callback = function()
|
||||
transparent = nil
|
||||
end,
|
||||
})
|
||||
end
|
||||
return transparent
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue