--- url: "https://www.w3.org/WAI/WCAG21/Understanding/relative-luminance.html" titulek: "MathML version of the relative luminance definition" h1: "MathML version of the relative luminance definition" popis: "" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 14:13:26" znaku: 2359 slov: 430 kodovani: "utf-8" sha256: "23c1b533707b4a98e3a2c9f3a802e214ea6903434d7e4d1072dfee503f720912" --- # MathML version of the relative luminance definition The following is a MathML version of the [WCAG 2.2 definition of relative luminance](./#dfn-relative-luminance). Refer to [MathML Software - Browsers](https://www.w3.org/Math/Software/mathml_software_cat_browsers.html) for information about browsers and plugins that support MathML which you may need in order to correctly display the information on this page. relative luminance the relative brightness of any point in a colorspace, normalized to 0 for darkest black and 1 for lightest white Note For the sRGB colorspace, the relative luminance of a color is defined as L = 0.2126 × R + 0.7152 × G + 0.0722 × B where **R**, **G** and **B** are defined as: If R s R G B ≤ 0.04045 then R = R s R G B 12.92 else R = ( R s R G B + 0.055 1.055 ) 2.4 If G s R G B ≤ 0.04045 then G = G s R G B 12.92 else G = ( G s R G B + 0.055 1.055 ) 2.4 If B s R G B ≤ 0.04045 then B = B s R G B 12.92 else B = ( B s R G B + 0.055 1.055 ) 2.4 and R s R G B , G s R G B , and B s R G B are defined as: R s R G B = R 8 b i t 255 G s R G B = G 8 b i t 255 B s R G B = B 8 b i t 255 (Formula taken from [[SRGB](./#bib-srgb)].) NoteBefore May 2021 the value of 0.04045 in the definition was different (0.03928). It was taken from an older version of the specification and has been updated. It has no practical effect on the calculations in the context of these guidelines. NoteAlmost 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. If using other color spaces, see [Understanding Success Criterion 1.4.3 Contrast (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum). NoteIf dithering occurs after delivery, then the source color value is used. For colors that are dithered at the source, the average values of the colors that are dithered should be used (average R, average G, and average B). NoteTools are available that automatically do the calculations when testing contrast and flash. [SRGB] [Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB](https://webstore.iec.ch/publication/6169). IEC. URL: [https://webstore.iec.ch/publication/6169](https://webstore.iec.ch/publication/6169)