Изменения

не надо выдавать ошибку при пустых значениях
Строка 137: Строка 137:     
function p._ratio(args)
 
function p._ratio(args)
local v1 = color2lum(mw.text.unstripNoWiki(args[1]))
+
local v1 = color2lum(mw.text.unstripNoWiki(args[1] or ''))
local v2 = color2lum(mw.text.unstripNoWiki(args[2]))
+
local v2 = color2lum(mw.text.unstripNoWiki(args[2] or ''))
 
if (type(v1) == 'number' and type(v2) == 'number') then
 
if (type(v1) == 'number' and type(v2) == 'number') then
 
-- v1 should be the brighter of the two.
 
-- v1 should be the brighter of the two.
Анонимный участник