MathML version of the luminosity contrast ratio definition

The following is a MathML version of the WCAG 2.0 definition of luminosity contrast ratio. Refer to MathML Software - Browsers for information about browsers that support MathML and can correctly display the information on this page. At the time of publication, support for MathML was not sufficient to include it in the body of the guidelines. If this changes prior to publication, this version will be included in the guidelines themselves.

luminosity contrast ratio

L 1 + 0.05 L 2 + 0.05 , where L1 is the luminosity of the lighter of the text or background colors, and L2 is the luminosity of the darker of the text or background colors.

Note 1: The luminosity of a color is defined as 0.2126 ( ( R F S ) 2.2 ) + 0.7152 ( ( G F S ) 2.2 ) + 0.0722 ( ( B F S ) 2.2 )

  • R, G, and B are the red, green, and blue RGB values of the color.

  • FS is the maximum possible full scale RGB value for R, G, and B (255 for eight bit color channels).

Note 2: Luminosity values can range from 0 (black) to 1 (white), and luminosity contrast ratios can range from 1 to 21.