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

View File

@@ -8,13 +8,13 @@
local joke = ""
local txt = ""
function urlencode(str)
if (str) then
function urlencode(str)
if (str) then
str = string.gsub(str, "\n", "\r\n")
str = string.gsub(str, "([^%w _ %- . ~])", function (c) return string.format ("%%%02X", string.byte(c)) end)
str = string.gsub(str, " ", "+")
end
return str
str = string.gsub(str, " ", "+")
end
return str
end
function urldecode(str)
@@ -24,12 +24,12 @@ function urldecode(str)
end
function on_alarm()
http:get("http://api.icndb.com/jokes/random")
http:get("http://api.icndb.com/jokes/random")
end
function on_network_result(result)
local first_letter = string.sub(result, 1, 1)
local textColor = ui:get_secondary_text_color()
local textColor = ui:get_colors().secondary_text
joke = ajson:get_value(result, "object object:value string:joke")
local id = ajson:get_value(result, "object object:value string:id")