add get_colors function
This commit is contained in:
17
samples/colors-sample.lua
Normal file
17
samples/colors-sample.lua
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user