mirror of
https://github.com/gabehf/base46.git
synced 2026-03-09 23:48:16 -07:00
Add the base16.theme_from_array function.
This commit is contained in:
parent
a633a3f02b
commit
7cbd7b2af5
2 changed files with 37 additions and 1 deletions
|
|
@ -1108,6 +1108,16 @@ themes["zenburn"] = {
|
|||
return setmetatable({
|
||||
themes = themes,
|
||||
apply_theme = apply_base16_theme,
|
||||
theme_from_array = function(array)
|
||||
assert(#array == 16, "base16.theme_from_array: The array length must be 16")
|
||||
local result = {}
|
||||
for i, value in ipairs(array) do
|
||||
assert(#value == 6, "base16.theme_from_array: array values must be in 6 digit hex format, e.g. 'ffffff'")
|
||||
local key = ("base%02X"):format(i - 1)
|
||||
result[key] = value
|
||||
end
|
||||
return result
|
||||
end,
|
||||
theme_names = function()
|
||||
local result = {}
|
||||
for k in pairs(themes) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue