add calc sample

This commit is contained in:
Evgeny
2021-08-08 07:50:28 +03:00
parent 7682f6fccd
commit 47a866e261
2 changed files with 38 additions and 0 deletions

9
lib/misc.lua Normal file
View File

@@ -0,0 +1,9 @@
function parseHexColor(text)
local r = tonumber('0x' .. string.sub(text, -8, -7))
local g = tonumber('0x' .. string.sub(text, -6, -5))
local b = tonumber('0x' .. string.sub(text, -4, -3))
local a = tonumber('0x' .. string.sub(text, -2))
return r, g, b, a
end