Module:Color contrast: Difference between revisions

    m>Frietjes
    (fix)
    m>Frietjes
    (typo)
    Line 123: Line 123:


    function p._ratio(args)
    function p._ratio(args)
    local v1 = color2lum(c[1])
    local v1 = color2lum(args[1])
    local v2 = color2lum(c[2])
    local v2 = color2lum(args[2])
    if (type(v1) == 'number' and type(v2) == 'number') then
    if (type(v1) == 'number' and type(v2) == 'number') then
    return (v2 + 0.05)/(v1 + 0.05)
    return (v2 + 0.05)/(v1 + 0.05)