@@ -25,6 +25,7 @@ spec:css-color-3
25
25
26
26
<pre class="link-defaults">
27
27
spec:css-color-5; type:dfn; text:color
28
+ spec:compositing-1; type:value; text:normal
28
29
</pre>
29
30
<link rel="stylesheet" href="style.css" />
30
31
@@ -34,8 +35,8 @@ Introduction {#intro}
34
35
35
36
<em> This section is not normative.</em>
36
37
37
- This module adds a new <<color>> function :
38
- ''contrast-color()'' .
38
+ This module adds a\two new <<color>> functions :
39
+ ''contrast-color()'' and ''color-layers()'' .
39
40
40
41
41
42
@@ -295,7 +296,59 @@ Contrasting Semi-transparent Colors</h4>
295
296
to find an opaque foreground color.
296
297
297
298
299
+ <!--
298
300
301
+ █▌ ███▌ █ ▐▌ █████▌ ████▌ ███▌
302
+ █▌ ▐█ ▐█ ▐▌ █ █▌ █▌ █▌ █▌ █▌
303
+ █▌ █▌ █▌ █ ▐▌ █▌ █▌ █▌ █▌
304
+ █▌ █▌ █▌ ▐▌█ ████ ████▌ ███▌
305
+ █▌ █████▌ █▌ █▌ █▌▐█ █▌
306
+ █▌ █▌ █▌ █▌ █▌ █▌ ▐█ █▌ █▌
307
+ █████ █▌ █▌ █▌ █████▌ █▌ █▌ ███▌
308
+ -->
309
+
310
+ Layering Multiple Colors: the ''color-layers()'' function {#colorclayers}
311
+ =========================================================================
312
+
313
+ The <dfn>color-layers()</dfn> [=functional notation=]
314
+ takes an optional <<blend-mode>>
315
+ followed by a list of two or more
316
+ <<color>> layers.
317
+
318
+ Its syntax is:
319
+
320
+ <pre class='prod'>
321
+ <<color-layers()>> = color-layers([ <<blend-mode>> , ]? <<color>> # )
322
+ </pre>
323
+
324
+ It returns a <<color>> which is
325
+ the result of compositing these layers,
326
+ using the [[compositing-1#porterduffcompositingoperators_srcover]]
327
+ compositing operator and the specified
328
+ <<blend-mode>> .
329
+
330
+ If no <<blend-mode>> is given,
331
+ ''normal'' blend-mode is used.
332
+
333
+ <div class="example">
334
+ @@Add simple example with normal blend mode
335
+ and two colors, the first of which has non-unity alpha
336
+ </div>
337
+
338
+ <div class="example">
339
+ @@Add simple example with normal blend mode
340
+ and three colors, the first two of which have non-unity alpha
341
+ </div>
342
+
343
+ <div class="example">
344
+ @@Add simple example with normal blend mode
345
+ and two colors, both of which have non-unity alpha
346
+ </div>
347
+
348
+ <div class="example">
349
+ @@Add example with overlay blend mode
350
+ and two colors, the first of which has non-unity alpha
351
+ </div>
299
352
300
353
<!--
301
354
████████ ████████ ██████ ███████ ██ ██ ██ ████████
0 commit comments