1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 15:40:04 +08:00
SpaceVim/bundle/cpicker.nvim/lua/cpicker/util.lua

23 lines
591 B
Lua
Raw Normal View History

2024-07-13 18:52:07 +08:00
--=============================================================================
-- util.lua
-- Copyright (c) 2019-2024 Wang Shidong & Contributors
-- Author: Wang Shidong < wsdjeg@outlook.com >
-- URL: https://spacevim.org
-- License: GPLv3
--=============================================================================
local M = {}
local color = require('spacevim.api.color')
function M.generate_bar(n, char, m)
2024-07-13 21:59:34 +08:00
return string.rep(char, math.floor(24 * n / (m or 1)))
2024-07-13 18:52:07 +08:00
end
function M.get_hex_code(t, code)
return color[t .. '2hex'](unpack(code))
end
return M