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.
$\frac{L1+0.05}{L2+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\left({\left(\frac{R}{FS}\right)}^{2.2}\right)+0.7152\left({\left(\frac{G}{FS}\right)}^{2.2}\right)+0.0722\left({\left(\frac{B}{FS}\right)}^{2.2}\right)$
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.