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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
|
---
title: <blend-mode>
slug: Web/CSS/blend-mode
translation_of: Web/CSS/blend-mode
---
<p>{{CSSRef}}</p>
<h2 id="Описание" style="">Описание</h2>
<p>The <strong><code><blend-mode></code></strong> type is a collection of keywords describing blend modes.</p>
<p>A blend mode is a method of calculating the final color value of a pixel when layers overlap. Each blend mode takes the color value of the foreground and the backdrop (top color and bottom color respectively), perfoms its calculation and returns a color value. The final, visible layer is the result of performing the blend mode calculation on every overlapping pixel among the blended layers.</p>
<h2 id="Синтаксис" style="">Синтаксис</h2>
<pre class="syntaxbox">Формальный синтаксис: normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity</pre>
<h3 id="Возможные_значения" style="">Возможные значения</h3>
<dl style="">
<dt><code>normal</code></dt>
<dd>
<p>The final color is the top color, whatever the bottom color may be.<br>
The effect is similar to two opaque pieces of paper overlapping.</p>
<div id="normal">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: normal;
}</pre>
</div>
<p>{{ EmbedLiveSample('normal', "300", "300") }}</p>
</dd>
<dt><code>multiply</code></dt>
<dd>
<p>The final color is the result of multiplying the top and bottom colors.<br>
A black layer leads to a black final layer, and a white layer leads to no change.<br>
The effect is similar to two images printed on transparent film overlapping.</p>
<div id="multiply">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: multiply;
}</pre>
</div>
<p>{{ EmbedLiveSample('multiply', "300", "300") }}</p>
</dd>
<dt><code>screen</code></dt>
<dd>
<p>The final color is the result of inverting the colors, multiplying them and inverting that color value.<br>
A black layer leads to no change, and a white layer leads to a white final layer.<br>
The effect is similar to two images shone onto a projection screen.</p>
<div id="screen">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: screen;
}</pre>
</div>
<p>{{ EmbedLiveSample('screen', "300", "300") }}</p>
</dd>
<dt><code>overlay</code></dt>
<dd>The final color is the result of <code>multiply</code> if the bottom color is darker, or <code>screen</code> if the bottom color is lighter.<br>
This blend mode is equivalent to <code>hard-light</code> but with the layers swapped.
<div id="overlay">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: overlay;
}</pre>
</div>
<p>{{ EmbedLiveSample('overlay', "300", "300") }}</p>
</dd>
<dt><code>darken</code></dt>
<dd>
<p>The final color is a color composed of the darkest values per color channel.</p>
<div id="darken">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: darken;
}</pre>
</div>
<p>{{ EmbedLiveSample('darken', "300", "300") }}</p>
</dd>
<dt><code>lighten</code></dt>
<dd>
<p>The final color is a color composed of the lightest values per color channel.</p>
<div id="lighten">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: lighten;
}</pre>
</div>
<p>{{ EmbedLiveSample('lighten', "300", "300") }}</p>
</dd>
<dt><code>color-dodge</code></dt>
<dd>
<p>The final color is the result of dividing the bottom color by the inverse of the top color.<br>
A black foreground leads to no change. A foreground with the inverse color of the backdrop leads to a fully lit color.<br>
This blend mode is similar to screen, but the foreground need only be as light as the inverse of the backdrop to reach a fully lit color.</p>
<div id="color-dodge">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: color-dodge;
}</pre>
</div>
<p>{{ EmbedLiveSample('color-dodge', "300", "300") }}</p>
</dd>
<dt><code>color-burn</code></dt>
<dd>
<p>This final color is the result of inverting the bottom color, dividing the value by the top color, and inverting that value.<br>
A white foreground leads to no change. A foreground with the inverse color of the backdrop leads to a black final image.<br>
This blend mode is similar to multiply, but the foreground need only be as dark as the inverse of the backdrop to make the final image black.</p>
<div id="color-burn">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: color-burn;
}</pre>
</div>
<p>{{ EmbedLiveSample('color-burn', "300", "300") }}</p>
</dd>
<dt><code>hard-light</code></dt>
<dd>
<p>The final color is the result of <code>multiply</code> if the top color is darker, or <code>screen</code> if the top color is lighter.<br>
This blend mode is equivalent to <code>overlay</code> but with the layers swapped.<br>
The effect is similar to shining a <em>harsh</em> spotlight on the backdrop.</p>
<div id="hard-light">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: hard-light;
}</pre>
</div>
<p>{{ EmbedLiveSample('hard-light', "300", "300") }}</p>
</dd>
<dt><code>soft-light</code></dt>
<dd>
<p>The final color is similar to hard-light, but softer.<br>
This blend mode behaves similar to <code>hard-light</code>.<br>
The effect is similar to shining a <em>diffused</em> spotlight on the backdrop<em><code>.</code></em></p>
<div id="soft-light">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: soft-light;
}</pre>
</div>
<p>{{ EmbedLiveSample('soft-light', "300", "300") }}</p>
</dd>
<dt><code>difference</code></dt>
<dd>
<p>The final color is the result of subtracting the darker of the two colors from the lighter one.<br>
A black layer has no effect, while a white layer inverts the other layer's color.</p>
<div id="difference">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: difference;
}</pre>
</div>
<p>{{ EmbedLiveSample('difference', "300", "300") }}</p>
</dd>
<dt><code>exclusion</code></dt>
<dd>
<p>The final color is similar to <code>difference,</code> but with less contrast.<br>
As with <code>difference</code>, a black layer has no effect, while a white layer inverts the other layer's color.</p>
<div id="exclusion">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: exclusion;
}</pre>
</div>
<p>{{ EmbedLiveSample('exclusion', "300", "300") }}</p>
</dd>
<dt><code>hue</code></dt>
<dd>
<p>The final color has the <em>hue</em> of the top color, while using the <em>saturation</em> and <em>luminosity</em> of the bottom color.</p>
<div id="hue">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: hue;
}</pre>
</div>
<p>{{ EmbedLiveSample('hue', "300", "300") }}</p>
</dd>
<dt><code>saturation</code></dt>
<dd>
<p>The final color has the <em>saturation</em> of the top color, while using the <em>hue</em> and <em>luminosity</em> of the bottom color.<br>
A pure gray backdrop, having no saturation, will have no effect.</p>
<div id="saturation">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: saturation;
}</pre>
</div>
<p>{{ EmbedLiveSample('saturation', "300", "300") }}</p>
</dd>
<dt><code>color</code></dt>
<dd>
<p>The final color has the<em> <em>hue</em></em> and <em><em>saturation</em> </em>of the top color, while using the <em>luminosity</em> of the bottom color.<br>
The effect preserves gray levels and can be used to colorize the foreground.</p>
<div id="color">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: color;
}</pre>
</div>
<p>{{ EmbedLiveSample('color', "300", "300") }}</p>
</dd>
<dt><code>luminosity</code></dt>
<dd style="">
<p>The final color has the <em>luminosity</em> of the top color, while using the <em>hue</em> and <em>saturation</em> of the bottom color.<br>
This blend mode is equivalent to color, but with the layers swapped.</p>
<div id="luminosity">
<pre class="brush: css" class="hidden">#div {
width: 300px;
height: 300px;
background: url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png');
background-blend-mode: luminosity;
}</pre>
</div>
<p style="">{{ EmbedLiveSample('luminosity', "300", "300") }}</p>
</dd>
</dl>
<h2 id="Интерполяция_режимов_наложения" style=""><span class="short_text" id="result_box" lang="ru"><span class="hps">Интерполяция режимов наложения</span></span></h2>
<div> </div>
<p>Changes between blends mode are not interpolated. Any change occurs abruptly.</p>
<h2 id="Спецификации" style="">Спецификации</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Спецификация</th>
<th scope="col">Статус</th>
<th scope="col">Комментарий</th>
</tr>
</thead>
<tbody>
<tr style="">
<td style="">{{ SpecName('Compositing', '#ltblendmodegt', '<blend-mode>') }}</td>
<td>{{ Spec2('Compositing') }}</td>
<td style="">Первоначальное определение</td>
</tr>
</tbody>
</table>
<h2 id="Browser_Compatibility" name="Browser_Compatibility" style="">Совместимость с браузерами</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop" style="">
<table class="compat-table">
<tbody>
<tr style="">
<th style="">Особенность</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Базовая поддержка</td>
<td>35</td>
<td>{{compatVersionUnknown()}}</td>
<td>{{compatUnknown()}}</td>
<td>{{compatUnknown()}}</td>
<td>{{compatUnknown()}}</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile" style="">
<table class="compat-table">
<tbody>
<tr style="">
<th style="">Особенность</th>
<th>Android</th>
<th>Chrome for Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Базовая поддержка</td>
<td>{{compatUnknown()}}</td>
<td>{{compatUnknown()}}</td>
<td>{{compatVersionUnknown()}}</td>
<td>{{compatUnknown()}}</td>
<td>{{compatUnknown()}}</td>
<td>{{compatUnknown()}}</td>
</tr>
</tbody>
</table>
</div>
<h2 id="Смотрите_также" style="">Смотрите также</h2>
<ul style="">
<li>Properties using a value of this type: {{cssxref("background-blend-mode")}} and {{cssxref("mix-blend-mode")}}</li>
<li style=""><a href="http://en.wikipedia.org/wiki/Blend_modes" style="">Blend modes</a></li>
<li style=""><a href="/en-US/docs/CSS/CSS_Reference" title="CSS Reference">CSS Reference</a> index</li>
</ul>
|