{"id":180839,"date":"2013-05-25T01:44:03","date_gmt":"2013-05-24T21:44:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=180839"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=180839","title":{"rendered":"<span class=\"post_title\">\u0410 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u044f \u0432\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b!<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/56b\/352\/9a7\/56b3529a77f2bb386c1a674289220d62.png\"\/><br \/>  <i>\u0441\u043a\u0440\u0438\u043d \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430<\/i><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0438\u0437\u043e\u0431\u0440\u0435\u043b \u0441\u0432\u043e\u0439 \u043b\u0438\u0447\u043d\u044b\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0440\u0438\u0441\u0443\u044e\u0449\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u043a \u0432 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u0435. \u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u044e, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u0436\u0430\u0441\u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0438 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/p>\n<h4>\u0417\u0430\u0447\u0435\u043c?<\/h4>\n<p>  \u041a\u0430\u043a-\u0442\u043e \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043c\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0443\u044e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u0432, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043d\u0430 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u043e\u0432\u0441\u043a\u0438\u0435. \u041d\u0438\u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0446\u0435\u043b\u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e, \u0442\u0430\u043a, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u043a\u0430 \u043d\u0430 \u0432\u0435\u0447\u0435\u0440. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 \u0431\u044b\u043b\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u0430 Java. \u0412\u0430\u0436\u043d\u043e\u0439 \u0438\u0434\u0435\u0435\u0439 \u0431\u044b\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0441\u0438\u043b\u0430\u043c\u0438, \u043d\u0435 \u043f\u043e\u0434\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u044f \u0432 \u0447\u0443\u0436\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h5>\u0427\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f<\/h5>\n<p>  \u041c\u0435\u0442\u043e\u0434 drawGradient() \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u0446\u0432\u0435\u0442\u0430 \u0434\u0432\u0443\u0445 \u0442\u043e\u0447\u0435\u043a, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u043e\u0432\u0435\u0440\u0445 \u0432\u0441\u0435\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/7e9\/8be\/987\/7e98be9872a7c25daecc7e5c44431599.png\"\/><\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u0442\u043e\u0447\u043a\u0430 A \u0438\u043c\u0435\u0435\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b (55; 20) \u0438 \u0446\u0432\u0435\u0442 0xff2e2e2e, \u0430 \u0442\u043e\u0447\u043a\u0430 B \u2014 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b (175; 180) \u0438 \u0446\u0432\u0435\u0442 0xffb5b5b5. \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043b\u0435\u0432\u043e\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0433\u043b\u0443, \u0430 \u043e\u0441\u044c Y \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043d\u0438\u0437.<\/p>\n<h5>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f<\/h5>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044d\u0442\u0430\u043b\u043e\u043d\u0430 \u044f \u0432\u0437\u044f\u043b \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0438\u0437 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u0430 \u0441 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/6e7\/b06\/b98\/6e7b06b985b75454c645de2bde816948.png\"\/><br \/>  \u041a\u0440\u0430\u0441\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u0430\u043b\u0438\u0442\u0430 \u0446\u0432\u0435\u0442\u043e\u043c \u0442\u043e\u0447\u043a\u0438 \u0410, \u0437\u0435\u043b\u0435\u043d\u0430\u044f \u2014 \u0442\u043e\u0447\u043a\u0438 B, \u0430 \u0446\u0432\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f \u0437\u043e\u043d\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u0442 \u043d\u0435\u0433\u043e \u0434\u043e \u043f\u0440\u044f\u043c\u044b\u0445 c \u0438 d.<\/p>\n<p>  \u0414\u0443\u043c\u0430\u044e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u0434\u043e \u043f\u0440\u044f\u043c\u044b\u0445 c \u0438 d. \u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u0435\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u043e\u0439 \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u043b\u0435\u0436\u0438\u0442 \u0432 \u00ab\u043a\u0440\u0430\u0441\u043d\u043e\u0439\u00bb \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043a\u0430\u043a\u043e\u0439 \u0432 \u00ab\u0437\u0435\u043b\u0435\u043d\u043e\u0439\u00bb, \u0430 \u043a\u0430\u043a\u043e\u0439 \u0432 \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438.<\/p>\n<p>  \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u0448\u043a\u043e\u043b\u044c\u043d\u044b\u0439 \u043a\u0443\u0440\u0441 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u0438 \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f E:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/1db\/b8e\/315\/1dbb8e315508dd2a24c52c43d4a7a8b1.png\"\/><\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0438\u0441\u0443\u043d\u043a\u0435 AF \u2014 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044f E \u0434\u043e \u043f\u0440\u044f\u043c\u043e\u0439 a. \u0418, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e, FB \u2014 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u043f\u0440\u044f\u043c\u043e\u0439 b. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0446\u0432\u0435\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044f. \u0418 \u0442\u0443\u0442 \u0436\u0435 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u043a \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043f\u0438\u043a\u0441\u0435\u043b\u044c. \u0422\u0443\u0442 \u0432\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u0415\u0441\u043b\u0438 AF + FB &gt; AB, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u043b\u0435\u0436\u0438\u0442 \u043b\u0438\u0431\u043e \u0432 \u043a\u0440\u0430\u0441\u043d\u043e\u0439, \u043b\u0438\u0431\u043e \u0432 \u0437\u0435\u043b\u0435\u043d\u043e\u0439 \u0437\u043e\u043d\u0435. \u0427\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e, \u0441\u0440\u0430\u0432\u043d\u0438\u043c AF \u0438 FB. \u0415\u0441\u043b\u0438 AF &gt; FB, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u043b\u0435\u0436\u0438\u0442 \u0432 \u0437\u0435\u043b\u0435\u043d\u043e\u0439 \u0437\u043e\u043d\u0435, \u0438\u043d\u0430\u0447\u0435 \u0432 \u043a\u0440\u0430\u0441\u043d\u043e\u0439. \u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0430\u0439\u0442\u0438 AF \u0438 BF. \u0421\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 AF, \u043f\u043e \u0442\u0435\u043e\u0440\u0435\u043c\u0435 \u041f\u0438\u0444\u0430\u0433\u043e\u0440\u0430 \u0432\u044b\u0445\u043e\u0434\u0438\u0442, \u0447\u0442\u043e:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/41c\/a30\/182\/41ca3018282e28623435fe7db793e7bd.gif\"\/><\/p>\n<p>  \u0422\u0430\u043a, \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0434\u043b\u0438\u043d\u044b AE \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0437\u043d\u0430\u0442\u044c \u0438\u0437 \u0442\u043e\u0439 \u0436\u0435 \u0442\u0435\u043e\u0440\u0435\u043c\u044b \u041f\u0438\u0444\u0430\u0433\u043e\u0440\u0430, \u0431\u043b\u0430\u0433\u043e \u043d\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u043e\u0447\u0435\u043a A \u0438 E. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/8ac\/888\/fb9\/8ac888fb950676e4d0254b0d7bb13398.gif\"\/><\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e EF. \u042d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0443\u0434\u043d\u0435\u0435, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e. \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0448 \u043e\u0442\u0440\u0435\u0437\u043e\u043a EF \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u044b\u0441\u043e\u0442\u0443 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430, \u043e\u043f\u0443\u0449\u0435\u043d\u043d\u0443\u044e \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 AB, \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0432\u044b\u0441\u043e\u0442\u044b. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u043d\u0430 \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/180\/605\/c25\/180605c25ba96bacbdb42685aca57a4d.gif\"\/><\/p>\n<p>  \u0410 p \u2014 \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0432\u0432\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u0435\u0449\u0435\u0439. \u042d\u0442\u043e \u043d\u0435 \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440, \u0430 \u043f\u043e\u043b\u0443\u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440. \u041f\u043e\u043c\u043d\u044e \u043f\u0430\u0440\u0443 \u0440\u0430\u0437 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u043b \u0432 \u0448\u043a\u043e\u043b\u0435 \u0444\u044d\u0439\u043b\u044b \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443. \u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/842\/c14\/4c9\/842c144c993be24280d5645edf8c56ba.gif\"\/><\/p>\n<p>  AB \u0438 EB \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 AE \u2014 \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 AF \u043a\u0430\u043a \u043d\u0430 \u043b\u0430\u0434\u043e\u043d\u0438:<br \/>  1. \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c AE, EB \u0438 AB<br \/>  2. \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c p<br \/>  3. \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c EF<br \/>  4. \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c AF<\/p>\n<p>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f BF \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d, \u043d\u0435 \u0431\u0443\u0434\u0443 \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c.<\/p>\n<h5>\u0421\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043a\u043e\u0434\u0438\u0442\u044c!<\/h5>\n<p>  \u042f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u0434\u043b\u044f BufferedImage, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e EditableImage. \u0418 \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435, \u043f\u043e \u043c\u043e\u0438\u043c \u043f\u0440\u0438\u043a\u0438\u0434\u043a\u0430\u043c, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0431\u044b\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:  <\/p>\n<pre><code class=\"java\">\tEditableImage(int width, int height); \/\/\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440  \tvoid clear(int color); \/\/\u0421\u0431\u0440\u043e\u0441 \u0432\u0441\u0435\u0445 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0446\u0432\u0435\u0442  \tvoid drawGradient(int x1, int y1, int color1, int x2, int y2, int color2); \/\/\u0421\u0430\u043c \u043c\u0435\u0442\u043e\u0434 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u0432  \tBufferedImage getImage(); \/\/\u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0438 \u0434\u0430\u043b\u0435\u0435 \u0432\u0441\u0435 \u0446\u0432\u0435\u0442\u0430 \u0432 \u043c\u043e\u0435\u043c \u043a\u043e\u0434\u0435 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 int, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:  <\/p>\n<pre><code>0xAARRGGBB AA - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438 (\u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 32\u0445 \u0431\u0438\u0442\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c\u044e) RR - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 GG - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0435\u043b\u0435\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 BB - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0438\u043d\u0435\u0433\u043e \u0446\u0432\u0435\u0442\u0430 <\/code><\/pre>\n<p>  \u0418\u0434\u0435\u044f \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0443\u0434\u043e\u0431\u043d\u0430 \u0442\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044f \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u0445\u043e\u0447\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0435 \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0444\u0438\u0448\u043a\u0438 \u043a\u0440\u043e\u043c\u0435 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0448\u0442\u0443\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0443 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Gradient.java &#8212; \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package ru.idgdima.gradient;  import javax.swing.*;  public class Gradient { \tpublic static final int IMG_WIDTH = 640; \tpublic static final int IMG_HEIGHT = 480;  \tprivate static GradientPanel panel; \/\/\u041f\u0430\u043d\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442  \tpublic static void main(String[] args) { \t\t\/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u043a\u043d\u043e, \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u0440\u0435\u0441\u0442 \u0438 \t\t\/\/\u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043a\u043d\u0430 \t\tJFrame frame = new JFrame(&quot;Test&quot;); \t\tframe.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); \t\tframe.setResizable(false);  \t\t\/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0430\u043d\u0435\u043b\u044c \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0435 \u0432 \u043e\u043a\u043d\u043e, \t\t\/\/\u043f\u043e\u0434\u0433\u043e\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u0434 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043d\u0435\u043b\u0438, \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u043e\u043a\u043d\u043e \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \t\t\/\/\u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0432\u0438\u0434\u0438\u043c\u044b\u043c \t\tpanel = new GradientPanel(IMG_WIDTH, IMG_HEIGHT); \t\tframe.add(panel); \t\tframe.pack(); \t\tframe.setLocationRelativeTo(null); \t\tframe.setVisible(true); \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">GradientPanel.java &#8212; \u043f\u0430\u043d\u0435\u043b\u044c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package ru.idgdima.gradient;  import javax.swing.*; import java.awt.*; import java.awt.image.BufferedImage;  public class GradientPanel extends JPanel { \tprivate BufferedImage image;  \tpublic GradientPanel(int width, int height) { \t\t\/\/\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043d\u0435\u043b\u0438 \t\tsuper(); \t\tsetPreferredSize(new Dimension(width, height));  \t\t\/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u0447\u0435\u0440\u043d\u044b\u043c\u0438 \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u043c\u0438, \u0440\u0438\u0441\u0443\u0435\u043c  \t\t\/\/\u043d\u0430 \u043d\u0435\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 BufferedImage \u0432 \u043f\u043e\u043b\u0435 \t\t\/\/\u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \t\tEditableImage gradientImage = new EditableImage(width, height); \t\tgradientImage.clear(0xff000000); \t\tgradientImage.drawGradient(55, 20, 0xff2e2e2e, 175, 180, 0xffb5b5b5); \t\timage = gradientImage.getImage(); \t}  \t@Override \tprotected void paintComponent(Graphics g) { \t\tsuper.paintComponent(g);  \t\t\/\/\u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043f\u0430\u043d\u0435\u043b\u0438. \u041f\u0440\u043e\u0441\u0442\u043e \u0440\u0438\u0441\u0443\u0435\u043c \u043d\u0430\u0448\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \t\t\/\/\u043f\u043e\u0432\u0435\u0440\u0445 \u043d\u0435\u0435: \t\tg.drawImage(image, 0, 0, null); \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">EditableImage.java &#8212; \u0421\u0430\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u043f\u043e\u043a\u0430 \u043f\u0443\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package ru.idgdima.gradient;  import java.awt.image.BufferedImage;  public class EditableImage { \tprivate int width; \tprivate int height; \tprivate int[] rgb; \/\/\u0432\u0441\u0435 \u043f\u0438\u043a\u0441\u0435\u043b\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \tBufferedImage image; \/\/\u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c getImage  \tpublic EditableImage(int width, int height) { \t\tthis.width = width; \t\tthis.height = height; \t\trgb = new int[width * height]; \/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \t\t\/\/\u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430 getImage \t\timage = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR); \t}  \t\/** \t * \u041c\u0435\u0442\u043e\u0434 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435\u043c \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0446\u0432\u0435\u0442 \t * @param color \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0446\u0432\u0435\u0442 \t *\/ \tpublic void clear(int color) { \t\tfor (int i = 0; i &lt; rgb.length; i++) { \t\t\trgb[i] = color; \t\t} \t}  \t\/** \t * \u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \t * @return \t *\/ \tpublic BufferedImage getImage() { \t\t\/\/\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u0438\u043a\u0441\u0435\u043b\u0438 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 rgb \u0432 image \t\timage.setRGB(0, 0, width, height, rgb, 0, width); \t\treturn image; \t}  \tpublic void drawGradient(int x1, int y1, int color1, \t\t\tint x2, int y2, int color2) { \t\t\/\/\u043f\u043e\u043a\u0430 \u043f\u0443\u0441\u0442\u043e \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435, \u043d\u043e \u043e\u043d\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0435\u0440\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443. \u0421\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430!<\/p>\n<p>  \u0423 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">drawGradient<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public void drawGradient(int x1, int y1, int color1, int x2, int y2, int color2) { \tfloat dx = x1 - x2; \/\/\u0412\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \tfloat dy = y1 - y2; \tfloat AB = (float) Math.sqrt(dx * dx + dy * dy); \/\/\u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437  \t\/\/\u041f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043f\u0438\u043a\u0441\u0435\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \tfor (int y = 0; y &lt; height; y++) { \t\tfor (int x = 0; x &lt; width; x++) { \t\t\tdx = x1 - x; \t\t\tdy = y1 - y; \t\t\tfloat AE2 = dx * dx + dy * dy; \t\t\tfloat AE = (float) Math.sqrt(AE2);  \t\t\tdx = x2 - x; \t\t\tdy = y2 - y; \t\t\tfloat EB2 = dx * dx + dy * dy; \t\t\tfloat EB = (float) Math.sqrt(EB2);  \t\t\tfloat p = (AB + AE + EB) \/ 2f;   \t\t\tfloat EF = 2 \/ AB * (float)Math.sqrt(Math.abs(p * (p - AB) * \t\t\t\t(p - AE) * (p - EB))) \t\t\tfloat EF2 = EF * EF;  \t\t\tfloat AF = (float) Math.sqrt(Math.abs(AE2 - EF2)); \t\t\tfloat BF = (float) Math.sqrt(Math.abs(EB2 - EF2));  \t\t\tif (AF + BF - 0.1f &gt; AB) { \t\t\t\t\/\/\u0415\u0441\u043b\u0438 \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u043b\u0435\u0436\u0438\u0442 \u0432 \u0437\u0435\u043b\u0435\u043d\u043e\u0439 \u0438\u043b\u0438 \u043a\u0440\u0430\u0441\u043d\u043e\u0439 \u0437\u043e\u043d\u0435 \t\t\t\trgb[y * width + x] = AF &lt; BF ? color1 : color2; \t\t\t} else { \/\/\u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0446\u0432\u0435\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044f \t\t\t\tfloat progress = AF \/ AB; \t\t\t\t\/\/\u041e\u0431 \u043c\u0435\u0442\u043e\u0434\u0435 interpolate \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u0434\u0430\u043b\u044c\u0448\u0435 \t\t\t\trgb[y * width + x] = interpolate(color1, color2, progress); \t\t\t} \t\t} \t} }  \/**  * @param num - \u0447\u0438\u0441\u043b\u043e  * @return 0, \u0435\u0441\u043b\u0438 num &lt; 0; 255, \u0435\u0441\u043b\u0438 num &gt; 255; \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 num  *\/ private static int clip(int num) { \treturn num &lt;= 0 ? 0 : (num &gt;= 255 ? 255 : num); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0447\u0442\u043e \u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f \u2014 Math.abs() \u0432\u0435\u0437\u0434\u0435, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0445\u043e\u0442\u044c \u043c\u0430\u043b\u0435\u0439\u0448\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u043d\u044f \u2014 Math.sqrt() \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b.<\/p>\n<p>  \u0410 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0435\u0441\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c <code>- 0.1f<\/code>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0436\u0430\u0441\u043d\u043e\u0435 \u043c\u0435\u0441\u0438\u0432\u043e. \u0418\u0437-\u0437\u0430 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0442\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0447\u0438\u0441\u043b\u043e:  <\/p>\n<pre><code class=\"java\">if (AF + BF - 0.1f &gt; AB) { <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c interpolate \u0438 \u0434\u0435\u043b\u043e \u0432 \u0448\u043b\u044f\u043f\u0435. \u041e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0446\u0432\u0435\u0442, \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0438 \u0447\u0438\u0441\u043b\u043e progress, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442 0 \u0434\u043e 1 \u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0434\u043e\u043b\u044e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0435\u0441\u043b\u0438 progress = 0, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0446\u0432\u0435\u0442, \u0435\u0441\u043b\u0438 progress = 1 \u2014 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0432\u0435\u0442, \u0430 \u0435\u0441\u043b\u0438 progress = 0.5 \u2014 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c. \u0417\u0430\u0434\u0430\u0447\u0430 \u044f\u0441\u043d\u0430, \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">interpolate<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">private int interpolate(int color1, int color2, float progress) { \t\/\/\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c \u043e\u0431\u0430 \u0446\u0432\u0435\u0442\u0430 \u043d\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \tint a1 = (color1 & 0xff000000) &gt;&gt;&gt; 24; \tint r1 = (color1 & 0x00ff0000) &gt;&gt;&gt; 16; \tint g1 = (color1 & 0x0000ff00) &gt;&gt;&gt; 8; \tint b1 = color1 & 0x000000ff;  \tint a2 = (color2 & 0xff000000) &gt;&gt;&gt; 24; \tint r2 = (color2 & 0x00ff0000) &gt;&gt;&gt; 16; \tint g2 = (color2 & 0x0000ff00) &gt;&gt;&gt; 8; \tint b2 = color2 & 0x000000ff;  \t\/\/\u0418 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \tfloat progress2 = (1 - progress); \tint newA = clip((int) (a1 * progress2 + a2 * progress)); \tint newR = clip((int) (r1 * progress2 + r2 * progress)); \tint newG = clip((int) (g1 * progress2 + g2 * progress)); \tint newB = clip((int) (b1 * progress2 + b2 * progress));  \t\/\/\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \treturn (newA &lt;&lt; 24) + (newR &lt;&lt; 16) + (newG &lt;&lt; 8) + newB; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h5>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442!<\/h5>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/65b\/921\/a87\/65b921a87ff40c9b605c17d8f46bee6f.png\"\/><\/p>\n<p>  \u0423\u0436\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u043d\u043e \u043d\u0430\u0448 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e, \u0430 \u0432 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u0435 \u0432 \u0445\u043e\u0434\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0434\u0440\u0443\u0433\u0430\u044f.<\/p>\n<h5>\u041f\u0440\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438<\/h5>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443. \u041b\u0435\u0432\u044b\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d \u043d\u0430\u0448\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c, \u043f\u0440\u0430\u0432\u044b\u0439 \u2014 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u043e\u043c. \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u0442\u043e\u0438\u0442 \u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430. \u0418 \u0447\u0435\u043c \u0442\u0435\u043c\u043d\u0435\u0435 \u0441\u0442\u0440\u043e\u043a\u0430, \u0442\u0435\u043c \u0442\u043e\u0447\u043a\u0430 \u043b\u0435\u0432\u0435\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/27e\/617\/f0d\/27e617f0d54715a1d9b2f3222b568f6b.png\"\/><br \/>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043b\u0438\u043d\u0438\u044f \u0443 \u043d\u0430\u0441 \u043f\u0440\u044f\u043c\u0430\u044f, \u043a\u0430\u043a \u0440\u0435\u043b\u044c\u0441\u0430. \u041d\u0430\u0434\u043e \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c. \u0412\u043e\u0442 \u0442\u0443\u0442 \u044f \u0442\u0430\u043a \u043d\u0438\u0447\u0435\u0433\u043e \u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435. \u041d\u0430\u0448\u0435\u043b \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430 \u0445\u0430\u0431\u0440\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0438\u0434\u044b \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u0438 \u0434\u0430\u0436\u0435 \u043a\u043e\u0434 \u0435\u0441\u0442\u044c: <a href=\"http:\/\/habrahabr.ru\/post\/142592\/\">habrahabr.ru\/post\/142592\/<\/a><\/p>\n<p>  \u041d\u0443 \u0447\u0442\u043e, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f! \u0412\u043e \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043b\u0430\u0441\u0441 EditableImage \u0434\u0432\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b:  <\/p>\n<pre><code class=\"java\">public static final int INTERPOLATION_LINEAR = 0; public static final int INTERPOLATION_COS = 1; <\/code><\/pre>\n<p>  \u0412\u043e \u0432\u0442\u043e\u0440\u044b\u0445 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434 interpolate, \u0447\u0442\u043e\u0431\u044b \u0435\u043c\u0443 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u0432\u0430\u043b\u0430\u0441\u044c \u043e\u0434\u043d\u0430 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">private int interpolate(int color1, int color2, float progress, int interpolation) { \t\/\/\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c \u043e\u0431\u0430 \u0446\u0432\u0435\u0442\u0430 \u043d\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \tint a1 = (color1 & 0xff000000) &gt;&gt;&gt; 24; \tint r1 = (color1 & 0x00ff0000) &gt;&gt;&gt; 16; \tint g1 = (color1 & 0x0000ff00) &gt;&gt;&gt; 8; \tint b1 = color1 & 0x000000ff;  \tint a2 = (color2 & 0xff000000) &gt;&gt;&gt; 24; \tint r2 = (color2 & 0x00ff0000) &gt;&gt;&gt; 16; \tint g2 = (color2 & 0x0000ff00) &gt;&gt;&gt; 8; \tint b2 = color2 & 0x000000ff;  \t\/\/\u0418 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \tfloat f; \tif (interpolation == INTERPOLATION_LINEAR) { \t\tf = progress; \t} else if (interpolation == INTERPOLATION_COS) { \t\tfloat ft = progress * 3.1415927f; \t\tf = (1 - (float) Math.cos(ft)) * 0.5f; \t} else { \t\tthrow new IllegalArgumentException(); \t} \tint newA = clip((int) (a1 * (1 - f) + a2 * f)); \tint newR = clip((int) (r1 * (1 - f) + r2 * f)); \tint newG = clip((int) (g1 * (1 - f) + g2 * f)); \tint newB = clip((int) (b1 * (1 - f) + b2 * f));  \t\/\/\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \treturn (newA &lt;&lt; 24) + (newR &lt;&lt; 16) + (newG &lt;&lt; 8) + newB; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 drawGradient \u0434\u043e\u0431\u0430\u0432\u0438\u043c <code>int interpolation<\/code> \u0438 \u0432 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 interpolate \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u044d\u0442\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e:  <\/p>\n<pre><code class=\"java\">rgb[y * width + x] = interpolate(color1, color2, progress , interpolation); <\/code><\/pre>\n<p>  \u0418 \u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 GradientPanel \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 drawGradient, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0435\u0433\u043e INTERPOLATION_COS<\/p>\n<p>  \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441 \u044d\u0442\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/cb5\/dbf\/64b\/cb5dbf64b7abc6efa85e692e23c70580.png\"\/><br \/>  \u0425\u043c, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u043d\u043e \u0432 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u0435 \u043b\u0438\u043d\u0438\u044f \u044f\u0432\u043d\u043e \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f. \u0427\u0442\u043e \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c? \u0422\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u0440\u044f\u043c\u0430\u044f, \u0442\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043a\u0440\u0438\u0432\u0430\u044f\u2026 \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043a\u0440\u0430\u0439\u043d\u043e\u0441\u0442\u0435\u0439?<\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0438\u0434\u0435\u044f, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 <code>INTERPOLATION_COS_LINEAR = 2<\/code><\/p>\n<p>  \u0410 \u0432 \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 interpolate \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d else if:  <\/p>\n<pre><code class=\"java\">} else if (interpolation == INTERPOLATION_COS_LINEAR) { \tfloat ft = progress * 3.1415927f; \tf = (progress + (1 - (float) Math.cos(ft)) * 0.5f) \/ 2f; } <\/code><\/pre>\n<p>  \u0418 \u043e \u0447\u0443\u0434\u043e, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u0438\u0437 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u0430!<br \/>  \u0421\u0430\u043c\u0438 \u043f\u043e\u0433\u043b\u044f\u0434\u0438\u0442\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/09c\/7b4\/54e\/09c7b454e9ce6b1ce2751cb050a99cd1.png\"\/><br \/>  \u041d\u0430\u0448\u0430 \u0441\u043b\u0435\u0432\u0430.<\/p>\n<p>  \u0410 \u0432\u043e\u0442 \u0432\u0430\u043c \u0434\u0432\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430, \u0441\u043e\u0432\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0435 \u0432 \u043e\u0434\u043d\u0443. \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f, \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0441\u0432\u0430\u043b\u0438\u0442\u044c \u043d\u0430 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f\u0445:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/23c\/7a3\/758\/23c7a3758178f89735f7956041608885.png\"\/><\/p>\n<p>  \u0423\u0440\u0430, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u043a\u0430\u043a \u0432 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u0435, \u0445\u043e\u0442\u044c \u0438 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0442\u0430\u043a \u043a\u0440\u0443\u0442\u043e, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043c\u043e\u0433\u0443. \u0418 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u044e \u0435\u0433\u043e \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0441\u043e \u0441\u0432\u043e\u0438\u043c.<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u0432, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u0438\u0445 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/180839\/\"> http:\/\/habrahabr.ru\/post\/180839\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/56b\/352\/9a7\/56b3529a77f2bb386c1a674289220d62.png\"\/><br \/>  <i>\u0441\u043a\u0440\u0438\u043d \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430<\/i><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0438\u0437\u043e\u0431\u0440\u0435\u043b \u0441\u0432\u043e\u0439 \u043b\u0438\u0447\u043d\u044b\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0440\u0438\u0441\u0443\u044e\u0449\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u043a \u0432 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u0435. \u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u044e, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u0436\u0430\u0441\u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0438 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/p>\n<h4>\u0417\u0430\u0447\u0435\u043c?<\/h4>\n<p>  \u041a\u0430\u043a-\u0442\u043e \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043c\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0443\u044e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u0432, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043d\u0430 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u043e\u0432\u0441\u043a\u0438\u0435. \u041d\u0438\u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0446\u0435\u043b\u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e, \u0442\u0430\u043a, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u043a\u0430 \u043d\u0430 \u0432\u0435\u0447\u0435\u0440. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 \u0431\u044b\u043b\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u0430 Java. \u0412\u0430\u0436\u043d\u043e\u0439 \u0438\u0434\u0435\u0435\u0439 \u0431\u044b\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0441\u0438\u043b\u0430\u043c\u0438, \u043d\u0435 \u043f\u043e\u0434\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u044f \u0432 \u0447\u0443\u0436\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b.  <\/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-180839","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/180839","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=180839"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/180839\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=180839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=180839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=180839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}