<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2006 rel. 3 sp1 (http://www.altova.com) by Ben Caldwell (W3C) -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
        "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link type="text/css" rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/base.css"/>
    <title>MathML version of the relative luminance definition</title>
  </head>
  <body>
    <h1>MathML version of the relative luminance definition</h1>
    <p>The following is a MathML version of the <a href="Overview.htmll#relativeluminancedef">WCAG 2.0 definition of relative luminance</a>. Refer to <a href="http://www.w3.org/Math/Software/mathml_software_cat_browsers.html">MathML Software - Browsers</a> 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.</p>
    <dl>
      <dt class="label">
        <a id="relativeluminancedef"> </a>relative luminance</dt>
      <dd>
        <p>the relative perceived brightness of any point, normalized to 0 for black and 1 for maximum white</p>
        <div class="note">
          <p class="prefix">
            Note 1: The The relative luminance of an sRGB color is defined as <math xmlns="http://www.w3.org/1998/Math/MathML">
              <mstyle displaystyle="true" mathcolor="blue" fontfamily="serif">
                <mi>L</mi><mo>=</mo><mn>0.2126</mn><mo>×</mo><mi>R</mi><mo>+</mo><mn>0.7152</mn><mo>×</mo><mi>G</mi><mo>+</mo><mn>0.0722</mn><mo>×</mo><mi>B</mi>
              </mstyle>
            </math> where <strong>R</strong>, <strong>G</strong> and <strong>B</strong> are defined as:
          </p>
          <ul>
            <li>
              <p>If <math xmlns="http://www.w3.org/1998/Math/MathML">
                  <mstyle displaystyle="true" mathcolor="blue" fontfamily="serif">
                    <msub>
                      <mi>R</mi>
                      <mrow>
                        <mi>s</mi>
                        <mi>R</mi>
                        <mi>G</mi>
                        <mi>B</mi>
                      </mrow>
                    </msub>
                    <mo>&le;</mo>
                    <mn>0.03928</mn>
                  </mstyle>
                </math> then <math xmlns="http://www.w3.org/1998/Math/MathML">
                  <mstyle displaystyle="true" mathcolor="blue" fontfamily="serif">
                    <mi>R</mi>
                    <mo>=</mo>
                    <mfrac>
                      <msub>
                        <mi>R</mi>
                        <mrow>
                          <mi>s</mi>
                          <mi>R</mi>
                          <mi>G</mi>
                          <mi>B</mi>
                        </mrow>
                      </msub>
                      <mn>12.92</mn>
                    </mfrac>
                  </mstyle>
                </math>
 else <math xmlns="http://www.w3.org/1998/Math/MathML">
                  <mstyle displaystyle="true" mathcolor="blue" fontfamily="serif">
                    <mi>R</mi>
                    <mo>=</mo>
                    <msup>
                      <mrow>
                        <mo>(</mo>
                        <mfrac>
                          <mrow>
                            <msub>
                              <mi>R</mi>
                              <mrow>
                                <mi>s</mi>
                                <mi>R</mi>
                                <mi>G</mi>
                                <mi>B</mi>
                              </mrow>
                            </msub>
                            <mo>+</mo>
                            <mn>0.055</mn>
                          </mrow>
                          <mn>1.055</mn>
                        </mfrac>
                        <mo>)</mo>
                      </mrow>
                      <mn>2.4</mn>
                    </msup>
                  </mstyle>
                </math>
              </p>
            </li>
            <li>
              <p>If <math xmlns="http://www.w3.org/1998/Math/MathML">
                  <mstyle displaystyle="true" mathcolor="blue" fontfamily="serif">
                    <msub>
                      <mi>G</mi>
                      <mrow>
                        <mi>s</mi>
                        <mi>R</mi>
                        <mi>G</mi>
                        <mi>B</mi>
                      </mrow>
                    </msub>
                    <mo>&le;</mo>
                    <mn>0.03928</mn>
                  </mstyle>
                </math> then <math xmlns="http://www.w3.org/1998/Math/MathML">
                  <mstyle displaystyle="true" mathcolor="blue" fontfamily="serif">
                    <mi>G</mi>
                    <mo>=</mo>
                    <mfrac>
                      <msub>
                        <mi>G</mi>
                        <mrow>
                          <mi>s</mi>
                          <mi>R</mi>
                          <mi>G</mi>
                          <mi>B</mi>
                        </mrow>
                      </msub>
                      <mn>12.92</mn>
                    </mfrac>
                  </mstyle>
                </math>
 else <math xmlns="http://www.w3.org/1998/Math/MathML">
                  <mstyle displaystyle="true" mathcolor="blue" fontfamily="serif">
                    <mi>G</mi>
                    <mo>=</mo>
                    <msup>
                      <mrow>
                        <mo>(</mo>
                        <mfrac>
                          <mrow>
                            <msub>
                              <mi>G</mi>
                              <mrow>
                                <mi>s</mi>
                                <mi>R</mi>
                                <mi>G</mi>
                                <mi>B</mi>
                              </mrow>
                            </msub>
                            <mo>+</mo>
                            <mn>0.055</mn>
                          </mrow>
                          <mn>1.055</mn>
                        </mfrac>
                        <mo>)</mo>
                      </mrow>
                      <mn>2.4</mn>
                    </msup>
                  </mstyle>
                </math>
              </p>
            </li>
            <li>
              <p>If <math xmlns="http://www.w3.org/1998/Math/MathML">
                  <mstyle displaystyle="true" mathcolor="blue" fontfamily="serif">
                    <msub>
                      <mi>B</mi>
                      <mrow>
                        <mi>s</mi>
                        <mi>R</mi>
                        <mi>G</mi>
                        <mi>B</mi>
                      </mrow>
                    </msub>
                    <mo>&le;</mo>
                    <mn>0.03928</mn>
                  </mstyle>
                </math> then <math xmlns="http://www.w3.org/1998/Math/MathML">
                  <mstyle displaystyle="true" mathcolor="blue" fontfamily="serif">
                    <mi>B</mi>
                    <mo>=</mo>
                    <mfrac>
                      <msub>
                        <mi>B</mi>
                        <mrow>
                          <mi>s</mi>
                          <mi>R</mi>
                          <mi>G</mi>
                          <mi>B</mi>
                        </mrow>
                      </msub>
                      <mn>12.92</mn>
                    </mfrac>
                  </mstyle>
                </math>
 else <math xmlns="http://www.w3.org/1998/Math/MathML">
                  <mstyle displaystyle="true" mathcolor="blue" fontfamily="serif">
                    <mi>B</mi>
                    <mo>=</mo>
                    <msup>
                      <mrow>
                        <mo>(</mo>
                        <mfrac>
                          <mrow>
                            <msub>
                              <mi>B</mi>
                              <mrow>
                                <mi>s</mi>
                                <mi>R</mi>
                                <mi>G</mi>
                                <mi>B</mi>
                              </mrow>
                            </msub>
                            <mo>+</mo>
                            <mn>0.055</mn>
                          </mrow>
                          <mn>1.055</mn>
                        </mfrac>
                        <mo>)</mo>
                      </mrow>
                      <mn>2.4</mn>
                    </msup>
                  </mstyle>
                </math>
              </p>
            </li>
          </ul>
		  <p>and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle displaystyle="true" mathcolor="blue" fontfamily="serif"><msub><mi>R</mi><mrow><mi>s</mi><mi>R</mi><mi>G</mi><mi>B</mi></mrow></msub><mo>,</mo><msub><mi>G</mi><mrow><mi>s</mi><mi>R</mi><mi>G</mi><mi>B</mi></mrow></msub><mo>,</mo><mrow><mspace width="1ex"></mspace><mtext>and</mtext><mspace width="1ex"></mspace></mrow><msub><mi>B</mi><mrow><mi>s</mi><mi>R</mi><mi>G</mi><mi>B</mi></mrow></msub></mstyle></math> are defined as:</p>
		  <ul>
		  <li><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle displaystyle="true" mathcolor="blue" fontfamily="serif"><msub><mi>R</mi><mrow><mi>s</mi><mi>R</mi><mi>G</mi><mi>B</mi></mrow></msub><mo>=</mo><mfrac><msub><mi>R</mi><mrow><mn>8</mn><mi>b</mi><mi>i</mi><mi>t</mi></mrow></msub><mn>255</mn></mfrac></mstyle></math></li>
		   <li><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle displaystyle="true" mathcolor="blue" fontfamily="serif"><msub><mi>G</mi><mrow><mi>s</mi><mi>R</mi><mi>G</mi><mi>B</mi></mrow></msub><mo>=</mo><mfrac><msub><mi>G</mi><mrow><mn>8</mn><mi>b</mi><mi>i</mi><mi>t</mi></mrow></msub><mn>255</mn></mfrac></mstyle></math></li>
		    <li><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle displaystyle="true" mathcolor="blue" fontfamily="serif"><msub><mi>B</mi><mrow><mi>s</mi><mi>R</mi><mi>G</mi><mi>B</mi></mrow></msub><mo>=</mo><mfrac><msub><mi>B</mi><mrow><mn>8</mn><mi>b</mi><mi>i</mi><mi>t</mi></mrow></msub><mn>255</mn></mfrac></mstyle></math></li>
		  </ul>
          <div class="note">
            <p class="prefix">(Formula taken from <a href="http://w3.org/TR/WCAG20/Overview.html#sRGB">[sRGB]</a> and <a href="http://w3.org/TR/WCAG20/Overview.html#IEC-4WD">[IEC-4WD]</a>.)</p>
          </div>
          <p class="prefix">Note 2: Almost all systems used today to view Web content assume sRGB encoding. Unless it is known that another color space will be used to process and display the content, authors should evaluate using sRGB colorspace.</p>
		  <p class="prefix">Note 3: For dithered colors, use average values of the colors used (average R, average G, and average B).</p>
          <p class="prefix">Note 4: Tools are available that automatically do the calculations when testing contrast and flash.</p>
        </div>
      </dd>
    </dl>
  </body>
</html>
