<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 19 May 2013 01:05:48 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Andreas Gohr's Blog: Calculating Color Contrast with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11045</guid>
      <link>http://www.phpdeveloper.org/news/11045</link>
      <description><![CDATA[<p>
In <A href="http://www.splitbrain.org/blog/2008-09/18-calculating_color_contrast_with_php">this new post</a> to his blog <i>Andreas Gohr</i> shares three handy functions he's come up with to check colors in an image with PHP.
</p>
<blockquote>
A good designer will choose high contrast colors fer backgrounds and texts without hesitation. But sometimes no human is involved in choosin' th' colors. For example when colors are assigned in a (pseudo) random manner. [...] After some googlin' I found a page explainin' different <A href="http://www.wat-c.org/tools/CCA/1.1/">color contrast algorithms</a>. Load the cannons! I used th' data from that page and implemented 3 color check functions in PHP.
</blockquote>
<p>
You can see a <A href="http://www.splitbrain.org/_static/color/index.php">live demo</a> of the script at work showing off the three color-finding functions: color difference, brightness difference and the luminosity contrast. There's also a method for calculating the Pythagorean distance between the colors included now too.
</p>]]></description>
      <pubDate>Fri, 19 Sep 2008 09:37:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mikko Koppanen's Blog: Choosing watermark color based on the background luminosity]]></title>
      <guid>http://www.phpdeveloper.org/news/8835</guid>
      <link>http://www.phpdeveloper.org/news/8835</link>
      <description><![CDATA[<p>
<i>Mikko Koppanen</i> has <a href="http://valokuva.org/?p=59">another blog entry</a> posted dealing with image manipulation with PHP and Imagick, this time it's a cool little script that lets you pick your watermark's color based on the image's background luminosity.
</p>
<blockquote>
Usually images are watermarked using a predefined color (let's say for example "white"). How well does this actually work when you're doing the watermark on a light or even a white image? The answer is simple: not very well.
</blockquote>
<p>
His <a href="http://valokuva.org/?p=59">example</a> uses the ImagickPixelIterator to check the luminosity of the background and assigns the text a value between black and white according to the background. Complete code with usage and examples of the resulting images are included.
</p>]]></description>
      <pubDate>Sat, 13 Oct 2007 16:04:00 -0500</pubDate>
    </item>
  </channel>
</rss>
