<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9040&amp;view=findpost&amp;p=88895</guid>
        <pubDate>Wed, 05 Nov 2003 16:46:50 +0000</pubDate>
        <title>Яркость цвета</title>
        <link>https://forum.sources.ru/index.php?showtopic=9040&amp;view=findpost&amp;p=88895</link>
        <description><![CDATA[WinterMute: Попробуй так:<br><br>COLORREF contrastColor( int R, int G, int B )<br>{<br> &nbsp;desaturationY = ( Max(R,G.B)+Min(R,G,B) )/2;<br> &nbsp;if( desaturationY &gt; 128 )return RGB( 0,0,0 );<br> &nbsp;<br> &nbsp;return RGB( 255, 255, 255 );<br>}]]></description>
        <author>WinterMute</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9040&amp;view=findpost&amp;p=88894</guid>
        <pubDate>Wed, 05 Nov 2003 15:26:57 +0000</pubDate>
        <title>Яркость цвета</title>
        <link>https://forum.sources.ru/index.php?showtopic=9040&amp;view=findpost&amp;p=88894</link>
        <description><![CDATA[Visitor: <a class='tag-url' href='http://pascal.sources.ru/cgi-bin/forum/YaBB.cgi?board=algorithm;action=display;num=1067315065' target='_blank'>1343... даже 1344.</a>]]></description>
        <author>Visitor</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9040&amp;view=findpost&amp;p=88893</guid>
        <pubDate>Wed, 05 Nov 2003 13:38:11 +0000</pubDate>
        <title>Яркость цвета</title>
        <link>https://forum.sources.ru/index.php?showtopic=9040&amp;view=findpost&amp;p=88893</link>
        <description><![CDATA[Voice: Подскажите плз какой-нть алгоритм понимания, яркий цвет или нет.<br>Возможные примеры:<br>if (R&gt;128)or(G&gt;128)or(B&gt;128) then<br> &nbsp; &nbsp; &nbsp;isBrightColor:=true<br> &nbsp; &nbsp; &nbsp;else isBrightColor:=false;<br>или<br>if (R+G+B)/3&gt;255 then<br> &nbsp; &nbsp; &nbsp;isBrightColor:=true<br> &nbsp; &nbsp; &nbsp;else isBrightColor:=false;<br>Но они не подходят, т.к. синий (B=255) темнее зеленого (G=255)<br>Как бы точно знать, яркий цвет или нет (он может быть не обязательно равен 255)<br>Мне нужно на лейбле какого-то цвета выводить надпись белым или черным в зависимости от того, какого цвета лейлб]]></description>
        <author>Voice</author>
        <category>Алгоритмы</category>
      </item>
	
      </channel>
      </rss>
	