Luminosity converter

Enter a colour in hex format and this will produce the grey colour with the same luminosity.

Preview: Colour: Grey:

Hex code of grey:


W3C luminosity definition

Taken from http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef

if RsRGB <= 0.03928 then R = RsRGB/12.92 else R = ((RsRGB+0.055)/1.055) ^ 2.4
if GsRGB <= 0.03928 then G = GsRGB/12.92 else G = ((GsRGB+0.055)/1.055) ^ 2.4
if BsRGB <= 0.03928 then B = BsRGB/12.92 else B = ((BsRGB+0.055)/1.055) ^ 2.4

L = 0.2126 * R + 0.7152 * G + 0.0722 * B

Luminosity Test Suite