Module:MOS degrees: Difference between revisions
Fixing function calls to the gamut module |
No edit summary |
||
| Line 19: | Line 19: | ||
local ratio = { tonumber(parsed[1]), tonumber(parsed[2]) } | local ratio = { tonumber(parsed[1]), tonumber(parsed[2]) } | ||
return ratio | return ratio | ||
end | |||
-- Helper function for parsing a UDP entered as a string "up-dp" | |||
-- To avoid potential issues, the "-" character is used instead of "|" | |||
function p.parse_udp(step_ratio_unparsed) | |||
local parsed = {} | |||
for entry in string.gmatch(step_ratio_unparsed, '([^,]+)') do | |||
local trimmed = entry:gsub("^%s*(.-)%s*$", "%1") | |||
table.insert(parsed, trimmed) -- Add to array | |||
end | |||
local udp = { tonumber(parsed[1]), tonumber(parsed[2]) } | |||
return udp | |||
end | end | ||