{"id":287655,"date":"2018-08-16T14:14:04","date_gmt":"2018-08-16T10:14:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=287655"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=287655","title":{"rendered":"\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u0432 JavaScript"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/419309\/\" class=\"post__text post__text-html js-mediator-article\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/y_\/yd\/ms\/y_ydmsbfcmndeis9idwvgkit2ke.jpeg\" alt=\"Fruit average color\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0434\u0435\u043b\u0430\u043b \u043b\u0438\u0441\u0442\u0430\u043b\u043a\u0443 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439. \u0421\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u044e\u0449\u0438\u0439 \u0442\u0435\u043a\u0441\u0442 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u0443\u0441\u0440\u0435\u0434\u043d\u0451\u043d\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0444\u043e\u0442\u043e. \u0422\u0435\u043c\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b<br \/>  \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0435\u0449\u0451 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0432\u0435\u0440\u0441\u0442\u043a\u0435.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"fon\">\u0424\u043e\u043d<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0446\u0432\u0435\u0442 \u043f\u043e\u0434\u043b\u043e\u0436\u043a\u0438. <a href=\"https:\/\/fast-average-color.github.io\/examples\/background.html\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a> <\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/fast-average-color.github.io\/examples\/background.html\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tw\/3f\/zo\/tw3fzojkm4e9rlyhdel_hnrue8g.jpeg\" alt=\"Background\"><\/a><\/p>\n<p>  <\/p>\n<h2 id=\"gradient\">\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442<\/h2>\n<p>  <\/p>\n<p>\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0443 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0438\u043b\u0438 \u043d\u0438\u0436\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0434\u043b\u043e\u0436\u043a\u0435 \u0434\u043b\u044f \u0442\u0435\u043a\u0441\u0442\u0430. \u041c\u0435\u0436\u0434\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439 \u0438 \u043f\u043e\u0434\u043b\u043e\u0436\u043a\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043f\u043b\u0430\u0432\u043d\u044b\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442. \u0421\u0442\u0438\u043b\u044c \u042f\u043d\u0434\u0435\u043a\u0441.\u0414\u0437\u0435\u043d\u0430. <a href=\"https:\/\/fast-average-color.github.io\/examples\/gradient.html\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a> <\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/fast-average-color.github.io\/examples\/gradient.html\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/op\/zr\/1s\/opzr1s-sz0zegp3ygul2xcmcri8.jpeg\" alt=\"Gradient\"><\/a><\/p>\n<p>  <\/p>\n<p>\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0432\u00a0\u0441\u0442\u0438\u043b\u0435 Minecraft\u00a0\u2014 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044f\u043c\u0438 (\u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u043e\u0441\u043a\u0430\u043c\u0438). <a href=\"https:\/\/fast-average-color.github.io\/examples\/gradient_stripes.html\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a> <\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/fast-average-color.github.io\/examples\/gradient_stripes.html\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8u\/cq\/bw\/8ucqbwqmgi_ohpuuojdxjn9jkdk.jpeg\" alt=\"Minecraft gradient\"><\/a><\/p>\n<p>  <\/p>\n<h2 id=\"ramka\">\u0420\u0430\u043c\u043a\u0430<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0431\u0430\u0433\u0435\u0442 \u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u044b, \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0441\u0442\u043e\u0440\u043e\u043d \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438.<br \/>  <a href=\"https:\/\/fast-average-color.github.io\/examples\/border.html\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a> <\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/fast-average-color.github.io\/examples\/border.html\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qn\/-a\/t0\/qn-at0vqxyor7rhde_j3lotmzcq.jpeg\" alt=\"Border\"><\/a><\/p>\n<p>  <\/p>\n<h2 id=\"ten\">\u0422\u0435\u043d\u044c<\/h2>\n<p>  <\/p>\n<p>\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0434\u0430\u043d\u0438\u0438 \u0446\u0432\u0435\u0442\u0430 \u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0439 \u0442\u0435\u043d\u0438. <a href=\"https:\/\/fast-average-color.github.io\/examples\/box-shadow.html\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a> <\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/fast-average-color.github.io\/examples\/box-shadow.html\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vz\/wd\/yi\/vzwdyi9glw9rubagwupkzwmylts.jpeg\" alt=\"Box shadow\"><\/a><\/p>\n<p>  <\/p>\n<p>\u0412 CSS \u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043d\u0435\u0439. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0441\u0442\u043e\u0440\u043e\u043d \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0442\u0435\u043d\u044c. <a href=\"https:\/\/fast-average-color.github.io\/examples\/box-shadow-4-sides.html\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a> <\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/fast-average-color.github.io\/examples\/box-shadow-4-sides.html\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/no\/j-\/qd\/noj-qduqmtjskxzttbdys_o8bli.jpeg\" alt=\"Box shadow, 4 sides\"><\/a><\/p>\n<p>  <\/p>\n<h2 id=\"video\">\u0412\u0438\u0434\u0435\u043e<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0432 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0435 \u0434\u043b\u044f \u0432\u0438\u0434\u0435\u043e. <a href=\"https:\/\/fast-average-color.github.io\/examples\/ambilight.html#4Sides\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a> <\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/fast-average-color.github.io\/examples\/ambilight.html#4Sides\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rh\/m9\/uy\/rhm9uybhniouivu3vm8i3tpsi4e.jpeg\" alt=\"Video, box shadow, 4 sides\"><\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0430\u0441\u0442\u0435\u0439 (30), \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u0434\u043b\u044f \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0442\u0435\u043d\u0438, \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u0430\u043a \u0443 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Ambilight\">Philips Ambilight<\/a>. <a href=\"https:\/\/fast-average-color.github.io\/examples\/ambilight.html#ManyPoints\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a> <\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/fast-average-color.github.io\/examples\/ambilight.html#ManyPoints\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0q\/ki\/gm\/0qkigm29m4gkdjig248en6n0kuw.jpeg\" alt=\"Video, Ambilight\"><\/a><\/p>\n<p>  <\/p>\n<h2 id=\"tekstovaya-fotografiya\">\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0424\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043a \u0441\u0438\u043c\u0432\u043e\u043b\u0443. <a href=\"https:\/\/fast-average-color.github.io\/examples\/text-photo.html\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a> <\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/fast-average-color.github.io\/examples\/text-photo.html\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/b9\/wh\/g4\/b9whg4a_betbs2kno0qevcgtqfm.jpeg\" alt=\"Text photo\"><\/a><\/p>\n<p>  <\/p>\n<h2 id=\"ispolzovanie\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u00ab<a href=\"https:\/\/github.com\/hcodes\/fast-average-color\">fast-average-color<\/a>\u00bb. \u041f\u0440\u0438 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0435 \u0446\u0432\u0435\u0442\u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0442.\u043a. \u043f\u0440\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u0438 \u0446\u0432\u0435\u0442 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f <a href=\"https:\/\/fast-average-color.github.io\/compare\/\">\u0431\u043e\u043b\u0435\u0435 \u0442\u0451\u043c\u043d\u044b\u043c<\/a>.<\/p>\n<p>  <\/p>\n<p><code>npm i -D fast-average-color<\/code><\/p>\n<p>  <\/p>\n<h3 id=\"primery\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b<\/h3>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0438\u0437 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, \u0432\u0438\u0434\u0435\u043e \u0438 canvas\u2019a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/github.com\/fast-average-color\/fast-average-color#getcolorresource-options\">.getColor()<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;html&gt; &lt;body&gt;     ...     &lt;div class=\"image-container\"&gt;         &lt;img src=\"image.png\" \/&gt;         &lt;div&gt;             Lorem ipsum dolor sit amet, consectetur adipiscing elit,             sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.         &lt;\/div&gt;     &lt;\/div&gt;     &lt;script src=\"https:\/\/unpkg.com\/fast-average-color\/dist\/index.min.js\"&gt;&lt;\/script&gt;     &lt;script&gt;         window.addEventListener('load', function() {             var                 fac = new FastAverageColor(),                 container = document.querySelector('.image-container'),                 color = fac.getColor(container.querySelector('img'));              container.style.backgroundColor = color.rgba;             container.style.color = color.isDark ? '#fff' : '#000';              console.log(color);             \/\/ {             \/\/     error: null,             \/\/     rgb: 'rgb(255, 0, 0)',             \/\/     rgba: 'rgba(255, 0, 0, 1)',             \/\/     hex: '#ff0000',             \/\/     hexa: '#ff0000ff',             \/\/     value: [255, 0, 0, 255],             \/\/     isDark: true,             \/\/     isLight: false             \/\/ }         }, false);     &lt;\/script&gt; &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0434\u043b\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u2014 <a href=\"https:\/\/github.com\/fast-average-color\/fast-average-color#getcolorasyncresource-callback-options\">.getColorAsync()<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;html&gt; &lt;body&gt;     ...     &lt;div class=\"image-container\"&gt;         &lt;img src=\"image.png\" \/&gt;         &lt;div&gt;             Lorem ipsum dolor sit amet, consectetur adipiscing elit,             sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.         &lt;\/div&gt;     &lt;\/div&gt;     &lt;script src=\"https:\/\/unpkg.com\/fast-average-color\/dist\/index.min.js\"&gt;&lt;\/script&gt;     &lt;script&gt;         var             fac = new FastAverageColor(),             container = document.querySelector('.image-container');          fac.getColorAsync(container.querySelector('img'), function(color) {             container.style.backgroundColor = color.rgba;             container.style.color = color.isDark ? '#fff' : '#000';              console.log(color);             \/\/ {             \/\/     error: null,             \/\/     rgb: 'rgb(255, 0, 0)',             \/\/     rgba: 'rgba(255, 0, 0, 1)',             \/\/     hex: '#ff0000',             \/\/     hexa: '#ff0000ff',             \/\/     value: [255, 0, 0, 255],             \/\/     isDark: true,             \/\/     isLight: false             \/\/ }         });     &lt;\/script&gt; &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0438 \u0432\u0438\u0434\u0435\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0441\u0442\u043e\u0438\u0442 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e <a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Web\/HTTP\/CORS\">CORS<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/fast-average-color\/fast-average-color\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 Github<\/a><\/li>\n<li><a href=\"https:\/\/www.npmjs.com\/package\/fast-average-color\">\u041f\u0430\u043a\u0435\u0442 \u0432 npm<\/a><\/li>\n<li><a href=\"https:\/\/fast-average-color.github.io\/examples\/background.html\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b<\/a><\/li>\n<\/ul>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/419309\/\"> https:\/\/habr.com\/post\/419309\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/419309\/\" class=\"post__text post__text-html js-mediator-article\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/y_\/yd\/ms\/y_ydmsbfcmndeis9idwvgkit2ke.jpeg\" alt=\"Fruit average color\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0434\u0435\u043b\u0430\u043b \u043b\u0438\u0441\u0442\u0430\u043b\u043a\u0443 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439. \u0421\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u044e\u0449\u0438\u0439 \u0442\u0435\u043a\u0441\u0442 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u0443\u0441\u0440\u0435\u0434\u043d\u0451\u043d\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0444\u043e\u0442\u043e. \u0422\u0435\u043c\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b<br \/>  \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0435\u0449\u0451 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0432\u0435\u0440\u0441\u0442\u043a\u0435.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-287655","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=287655"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287655\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}