Module:Color contrast: Difference between revisions

    m>Frietjes
    No edit summary
    m>Frietjes
    No edit summary
    Line 21: Line 21:
    local lum = ''
    local lum = ''
    if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then
    if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then
    local c = (1 - abs(2*l - 1))*s
    local c = (1 - math.abs(2*l - 1))*s
    local x = c*(1 - abs( mod(h/60, 2) - 1) )
    local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) )
    local m = l - c/2
    local m = l - c/2