-
Notifications
You must be signed in to change notification settings - Fork 275
/
Copy pathrelative-luminance.html
361 lines (358 loc) · 13.7 KB
/
relative-luminance.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link type="text/css" rel="stylesheet" href="https://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="./#dfn-relative-luminance">WCAG 2.2 definition of relative luminance</a>. Refer to <a href="https://www.w3.org/Math/Software/mathml_software_cat_browsers.html">MathML Software - Browsers</a> for information about browsers and plugins that support MathML which you may need in order to correctly display the information on this page.</p>
<dl>
<dt><dfn data-dfn-type="dfn" id="dfn-relative-luminance" tabindex="0">relative luminance</dfn></dt>
<dd><p>the relative brightness of any point in a colorspace, normalized to 0 for darkest black and 1 for lightest white</p>
<div class="note" role="note" id="issue-container-generatedID-128"><div role="heading" class="note-title marker" id="h-note-128" aria-level="3"><span>Note</span><!---0.410359%--></div><div class="">
<p>For the sRGB colorspace, the relative luminance of a color is defined as <math xmlns="http://www.w3.org/1998/Math/MathML">
<mstyle>
<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>
<msub>
<mi>R</mi>
<mrow>
<mi>s</mi>
<mi>R</mi>
<mi>G</mi>
<mi>B</mi>
</mrow>
</msub>
<mo>≤</mo>
<mn>0.04045</mn>
</mstyle>
</math> then <math xmlns="http://www.w3.org/1998/Math/MathML">
<mstyle>
<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>
<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>
<msub>
<mi>G</mi>
<mrow>
<mi>s</mi>
<mi>R</mi>
<mi>G</mi>
<mi>B</mi>
</mrow>
</msub>
<mo>≤</mo>
<mn>0.04045</mn>
</mstyle>
</math> then <math xmlns="http://www.w3.org/1998/Math/MathML">
<mstyle>
<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>
<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>
<msub>
<mi>B</mi>
<mrow>
<mi>s</mi>
<mi>R</mi>
<mi>G</mi>
<mi>B</mi>
</mrow>
</msub>
<mo>≤</mo>
<mn>0.04045</mn>
</mstyle>
</math> then <math xmlns="http://www.w3.org/1998/Math/MathML">
<mstyle>
<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>
<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>
<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"/>
<mtext>and</mtext>
<mspace width="1ex"/>
</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>
<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>
<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>
<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><p>(Formula taken from [<cite><a class="bibref" data-link-type="biblio" href="./#bib-srgb" title="Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB">SRGB</a></cite>].) </p>
</div>
</div>
<div class="note" role="note" id="issue-container-generatedID-129"><div role="heading" class="note-title marker" id="h-note-129" aria-level="3"><span>Note</span><!---0.410359%--></div><p class="">Before 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.</p></div>
<div class="note" role="note" id="issue-container-generatedID-130"><div role="heading" class="note-title marker" id="h-note-130" aria-level="3"><span>Note</span><!---0.410359%--></div><p class="">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. If using other color spaces, see <a href="https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum">Understanding Success Criterion 1.4.3</a>.
</p></div>
<div class="note" role="note" id="issue-container-generatedID-131"><div role="heading" class="note-title marker" id="h-note-131" aria-level="3"><span>Note</span><!---0.410359%--></div><p class="">If 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).
</p></div>
<div class="note" role="note" id="issue-container-generatedID-132"><div role="heading" class="note-title marker" id="h-note-132" aria-level="3"><span>Note</span><!---0.410359%--></div><p class="">Tools are available that automatically do the calculations when testing contrast and
flash.
</p></div>
</dd>
<dt id="bib-srgb">[SRGB]</dt>
<dd><a href="https://webstore.iec.ch/publication/6169"><cite>Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB</cite></a>. IEC. URL: <a href="https://webstore.iec.ch/publication/6169">https://webstore.iec.ch/publication/6169</a></dd>
</dl>
</body>
</html>