add get_colors function

This commit is contained in:
Evgeny
2021-09-01 07:50:17 +03:00
parent 2c2f11d52a
commit a1b6f73221
9 changed files with 35 additions and 20 deletions

17
samples/colors-sample.lua Normal file
View File

@@ -0,0 +1,17 @@
function on_resume()
local colors = ui:get_colors()
local colors_strings = stringify_table(colors)
ui:show_lines(colors_strings)
end
function stringify_table(tab)
local new_tab = {}
for k,v in pairs(tab) do
table.insert(new_tab, k..": "..tostring(v))
end
return new_tab
end