<?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>Mon, 06 Oct 2008 11:23:45 -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[Ibuildings Blog: Implementing Iterators]]></title>
      <guid>http://www.phpdeveloper.org/news/10870</guid>
      <link>http://www.phpdeveloper.org/news/10870</link>
      <description><![CDATA[<p>
On the Ibuildings blog <i>Ruud Alberts</i> <a href="http://www.ibuildings.com/blog/archives/1241-Implementing-Iterators.html">takes a look</a> at iterators - what they are and how they're used (including the objects the SPL makes available).
</p>
<blockquote>
Let's kickstart this blogpost by defining what an iterator actually is. According to wikipedia, an iterator is. A collection can pretty much be anything. The most obvious sources would be arrays, but other than that, iterations can be done over database resultsets, strings, datetime intervals, directories, file content and XML listings, to name a few.
</blockquote>
<p>
He looks at the iterator interface that comes bundled in the <a href="http://www.php.net/~helly/php/ext/spl/">SPL</a> and how you can create a custom one to loop through your own data collection. He includes an example - a colorful string iterator that "pretties up" an HTML string with various colors.
</p>]]></description>
      <pubDate>Wed, 20 Aug 2008 15:02:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Bergmann's Blog: ANSI Colors in PHPUnit Output]]></title>
      <guid>http://www.phpdeveloper.org/news/9829</guid>
      <link>http://www.phpdeveloper.org/news/9829</link>
      <description><![CDATA[<p>
<i>Sebastian Bergmann</i> <a href="http://sebastian-bergmann.de/archives/761-ANSI-Colors-in-PHPUnit-Output.html">shows off</a> a new feature of the latest PHPUnit release - the addition of ANSI colors to the runner's output.
</p>
<p>
Check out the screenshots <a href="http://www.flickr.com/photos/sebastian_bergmann/2340283723/">here</a> and <a href="http://www.flickr.com/photos/sebastian_bergmann/2340283719/">here</a>.
</p>
<p>
PHPunit is a member of the xUnit family of testing frameworks and provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results.
</p>]]></description>
      <pubDate>Thu, 20 Mar 2008 10:26:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mikko Koppanen's Blog: Padding thumbnail with color]]></title>
      <guid>http://www.phpdeveloper.org/news/9406</guid>
      <link>http://www.phpdeveloper.org/news/9406</link>
      <description><![CDATA[<p>
<i>Mikko Koppanen</i> has another image tutorial posted to his blog today - this time the focus is on <a href="http://valokuva.org/?p=92">padding a thumbnail</a> with the color of your choice automatically.
</p>
<blockquote>
Today's example originates from a question asked by a user. How do I thumbnail the image inside given dimensions proportionally and fill the "blank" areas with a color? Well, the answer is here.
</blockquote>
<p>
His code pulls in the source image, generates a thumbnail from it and makes a new image (the background) that's a bit bigger than the thumbnail. From there, the thumbnail is laid on top and the whole thing is output as another PNG. An example of the input and output image is included.
</p>]]></description>
      <pubDate>Fri, 11 Jan 2008 12:05:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Mikko Koppanen's Blog: Creating buttons with Imagick]]></title>
      <guid>http://www.phpdeveloper.org/news/9096</guid>
      <link>http://www.phpdeveloper.org/news/9096</link>
      <description><![CDATA[<p>
<i>Mikko Koppanen</i> has another quick new tutorial on using Imagick in your applications - this time it's about <a href="http://valokuva.org/?p=84">making buttons</a> dynamically.
</p>
<blockquote>
The button in this example is created after this tutorial <a href="http://xeonfx.com/tutorials/easy-button-tutorial/">http://xeonfx.com/tutorials/easy-button-tutorial/</a> (yes, I googled "easy button tutorial"). The code and the button it creates are both very simple but the effect looks really nice.
</blockquote>
<p>
The example code creates a simple round button with a fill color and white text. Their examples show a red, green and blue buttons.
</p>]]></description>
      <pubDate>Thu, 22 Nov 2007 17:05:50 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Mikko Koppanen's Blog: Color analysis]]></title>
      <guid>http://www.phpdeveloper.org/news/8970</guid>
      <link>http://www.phpdeveloper.org/news/8970</link>
      <description><![CDATA[<p>
In the latest entry to his blog, <i>Mikko Koppanen</i> shows how to take the power of Imagick and harness it to check and see what sorts of colors an image contains:
</p>
<blockquote>
The code in the example reduces the image colors to 10, then discards all but one pixel of every color and then creates the palettes out of those colors. This might not be the most accurate way to do this, but at least it's fast.
</blockquote>
<p>
<a href="http://valokuva.org/?p=72">His code</a> makes three different "palettes" from the image - average, dark and light - and outputs them as a range of colored boxes for each all of the three palettes. Examples of the output are also included in the post.
</p>]]></description>
      <pubDate>Mon, 05 Nov 2007 10:26:00 -0600</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>
    <item>
      <title><![CDATA[The Bakery: Four New Articles/Components (Colors, Models, InotImg & CakeSWXPHP)]]></title>
      <guid>http://www.phpdeveloper.org/news/8750</guid>
      <link>http://www.phpdeveloper.org/news/8750</link>
      <description><![CDATA[<p>
The Bakery has posted four new articles/components today bringing you more CakePHP goodness for your consumption:
</p>
<ul>
<li><a href="http://bakery.cakephp.org/articles/view/color-helper-random">Color Helper (Random)</a> - Need a way to distinguish one chunk from another? How about easy random background colors that are all within a reasonable range of values that look good with dark text.
<li><a href="http://bakery.cakephp.org/articles/view/model-loader">Model Loader</a> - This component helps you to load your models on the fly ( I mean in your actions, whenever).
<li><a href="http://bakery.cakephp.org/articles/view/inotimg-helper-for-reducing-rows-in-view">InotImg - helper for reducing rows in view</a> - When I was playing with images I always messed up with stuff which didn't belongs into view code. Like "if is_file(image" etc. but I want to be sure that there is going to be an image whether wanted or empty-image, so I wrote a following helper to make things easier.
<li><a href="http://bakery.cakephp.org/articles/view/cakeswxphp">CakeSWXPHP</a> - SWX is the native data format for Flash. It uses SWF files to store and exchange data. It is also an implementation of an RPC gateway (currently in PHP), tools (a data analyzer/debugger and a service explorer), various APIs (Flickr, Twitter, etc.), and an ActionScript library that make creating data driven Flash and Flash Lite applications a piece of cake.
</ul>
<p>
Be sure to check out the rest of the great content on <a href="http://bakery.cakephp.org">The Bakery</a> for even more CakePHP-ness.
</p>]]></description>
      <pubDate>Fri, 28 Sep 2007 12:05:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[WebReference.com: How To Create Alternating Row Colors in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/8086</guid>
      <link>http://www.phpdeveloper.org/news/8086</link>
      <description><![CDATA[<p>
WebReference.com has a <a href="http://www.webreference.com/programming/php_color/">simple new tutorial</a> today showing how to create alternating table rows in the output for your application.
</p>
<blockquote>
Almost every database driven Web site uses alternating row colors when displaying a list of records, a concept used all over the Internet.  You've seen it used, you like it, and now you want to do it yourself.  But you're not sure how to accomplish it.  Well you've come to the right place.  I'm going to discuss the basic idea behind achieving this and give some concrete examples demonstrating different ways to implement it.
</blockquote>
<p>
Their script loops through the information (numbers in their case) and checks, using the modulus operator to check and see which of the CSS styles it should apply to the div. To give a range of possibility, they also show how to do it with a while loop instead of a for to do a little benchmarking of the methods.
</p>]]></description>
      <pubDate>Wed, 20 Jun 2007 11:12:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[MSBWare.com: Alternating Row Colors]]></title>
      <guid>http://www.phpdeveloper.org/news/7760</guid>
      <link>http://www.phpdeveloper.org/news/7760</link>
      <description><![CDATA[<p>
Sometimes, a simple approach is the best. That's what <i>Michael Berman</i> went with in <a href="http://www.msbware.com/articles/PHP_Alternating_Row_Colors_1.html">this light and easy tutorial</a>. It focuses on the creation of an "alternating rows" script with PHP.
</p>
<blockquote>
This concept is used all over the internet.  Almost every database driven website uses alternating row colors when displaying a list of records.  You've seen it used, you like it, and now you want to do it yourself.  But, you're not sure how to accomplish it.  Well you've come to the right place.  I'm going to discuss the basic idea behind achieving this and give some concrete examples demonstrating different ways to implement it.
</blockquote>
<p>
The <a href="http://www.msbware.com/articles/PHP_Alternating_Row_Colors_1.html">example code</a> show how to alternate between two colors - white and grey - for the background of a series of DIVs. He even includes a series of tests to show which method of switching them out would be faster (while loop, for loop, etc).
</p>]]></description>
      <pubDate>Wed, 02 May 2007 16:13:00 -0500</pubDate>
    </item>
  </channel>
</rss>
