View source for Module:Color contrast
From All Skies Encyclopaedia
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
--
-- This module implements
-- {{Color contrast ration}}
-- {{ColorToLum}}
-- {{RGBColorToLum}}
--
local p = {}
local function sRGB ( v )
if (v <= 0.03928) then
v = v / 12.92
else
v = math.pow((v+0.055)/1.055, 2.4)
end
return v
end
local function color2lum( c )
if (c == nil) then
000
1:0
Template used on this page:
Return to Module:Color contrast.