@@ -257,12 +257,12 @@ The 'dynamic-range-limit' property {#the-dynamic-range-limit-property}
257
257
258
258
<pre class='propdef'>
259
259
Name : dynamic-range-limit
260
- Value : standard | high | constrained-high
260
+ Value : standard | high | constrained-high | ''dynamic-range-limit-mix()''
261
261
Initial : high
262
262
Applies to : all elements
263
263
Inherited : no
264
264
Percentages : n/a
265
- Computed value : specified value
265
+ Computed value : see <a href="#computing-dynamic-range-limit">Computed Value for 'dynamic-range-limit'</a>
266
266
Animation type : by ''dynamic-range-limit-mix()''
267
267
Canonical order : per grammar
268
268
</pre>
@@ -309,10 +309,49 @@ Mixing Dynamic Range Limits: the ''dynamic-range-limit-mix()'' function {#dynami
309
309
310
310
311
311
<pre class='prod'>
312
- <dfn>dynamic-range-limit-mix()</dfn> = dynamic-range-limit-mix( [ <<ident>> && <<percentage [0,100]>> ? ]#{2} )
312
+ <dfn>dynamic-range-limit-mix()</dfn> = dynamic-range-limit-mix( [ <<ident>> && <<percentage [0,100]>> ]+ )
313
313
</pre>
314
314
315
- Percentages are normalized in the same way as ''color-mix()'' .
315
+ If the sum of all percentages is 0%, then the function is invalid.
316
+
317
+ <h3 id="computing-dynamic-range-limit">
318
+ Computed Value for 'dynamic-range-limit'
319
+ </h3>
320
+
321
+ If the specified value is ''standard'' , ''constrained-high'' , or ''high'' , then the computed value is the specified value.
322
+
323
+ If the specified value is ''dynamic-range-limit-mix()'' , then the computed value is determined by the following algorithm:
324
+
325
+ 1. Let <var> v1</var> , ..., <var> vN</var> be the computed values for the parameters to be mixed.
326
+ 2. Let <var> p1</var> , ..., <var> pN</var> be the mixing percentages, normalized to sum to 100%.
327
+ 3. Define the contributing percentages as:
328
+ * Let <var> p1_standard</var> ,...,<var> pN_standard</var> be the percentages for ''standard'' in <var> v1</var> ,...,<var> vN</var>
329
+ * Let <var> p1_constrained_high</var> ,...,<var> pN_constrained_high</var> be the percentages for ''constrained-high'' in <var> v1</var> ,...,<var> vN</var>
330
+ * Let <var> p1_high</var> ,...,<var> pN_high</var> be the percentages for ''high'' in <var> v1</var> ,...,<var> vN</var>
331
+ 4. Compute the weighted sums as:
332
+ * <var> p_standard</var> =(<var> p1_standard</var> *<var> p1</var> +...+<var> pN_standard</var> *<var> pN</var> )/100.
333
+ * <var> p_constrained_high</var> =(<var> p1_constrained_high</var> *<var> p1</var> +...+<var> pN_constrained_high</var> *<var> pN</var> )/100.
334
+ * <var> p_high</var> =(<var> p1_high</var> *<var> p1</var> +...+<var> pN_high</var> *<var> pN</var> )/100.
335
+ 5. If <var> p_standard</var> , <var> p_constrained_high</var> , or <var> p_high</var> equals 100%, then
336
+ the computed value is ''standard'' , ''constrained-high'' , or ''high'' , respectively.
337
+ 6. Otherwise, the computed value is ''dynamic-range-limit-mix()'' , with parameters
338
+ ''standard'' , ''constrained-high'' , and ''high'' , in that order, and percentages
339
+ <var> p_standard</var> , <var> p_constrained_high</var> , and <var> p_high</var> ,
340
+ omitting parameters with a percentage equal to 0%.
341
+
342
+ <div class="example" id="ex-hdr-limit-mix">
343
+ The computed value of
344
+ <pre class="lang-css">
345
+ dynamic-range-limit-mix(
346
+ high 10%,
347
+ dynamic-range-limit-mix(standard 25%, constrained-high 75%) 20%,
348
+ dynamic-range-limit-mix(constrained-high 10%, high 30%) 20%)
349
+ </pre>
350
+ is
351
+ <pre class="lang-css">
352
+ dynamic-range-limit-mix(standard 10%, constrained-high 40%, high 50%)
353
+ </pre>
354
+ </div>
316
355
317
356
<h2 id="color-function">
318
357
Specifying Predefined and Custom Color Spaces: the ''color()'' Function
0 commit comments