function splitString(aString)
local result = {} --store the values here in order
for label, value in aString:gmatch("([^%s:]+):(-?%d+%.?%d*)") do --separate what we want from aString
table.insert(result, tonumber(value)) --insert the values we got inside the table
end
return result --return the baked cake
end
-- example:
local yourString = "Brightness:0.5 Contrast:-0.1 Saturation:0"
local splitResult = splitString(yourString)
for _, value in ipairs(splitResult) do
print(value)
end