<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Random web page background colors</title>
	<link>http://www.php-scripts.com/20060714/89/</link>
	<description>Writing about PHP scripting since 12/99. Learn something new every day.</description>
	<pubDate>Thu, 17 May 2012 01:53:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: rachel jenkins</title>
		<link>http://www.php-scripts.com/20060714/89/#comment-159315</link>
		<dc:creator>rachel jenkins</dc:creator>
		<pubDate>Mon, 06 Feb 2012 04:40:05 +0000</pubDate>
		<guid>http://www.php-scripts.com/20060714/89/#comment-159315</guid>
		<description>&lt;strong&gt;&#60; b &#62;&#60; a href="http://www.job-run.com/wikka/LisaAiuq" &#62;bob hairstyles&#60; /a &#62;&#60; /b &#62;&#60; /blockquote &#62;&lt;/strong&gt;

I like the helpful info you provide in your articles. I will bookmark your weblog and check again here regularly. I'm quite certain I’ll learn plenty of new stuff right here! Good luck for the next!</description>
		<content:encoded><![CDATA[<p><strong>&lt; b &gt;&lt; a href=&#8221;http://www.job-run.com/wikka/LisaAiuq&#8221; &gt;bob hairstyles&lt; /a &gt;&lt; /b &gt;&lt; /blockquote &gt;</strong></p>
<p>I like the helpful info you provide in your articles. I will bookmark your weblog and check again here regularly. I&#8217;m quite certain I’ll learn plenty of new stuff right here! Good luck for the next!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeremy</title>
		<link>http://www.php-scripts.com/20060714/89/#comment-89247</link>
		<dc:creator>jeremy</dc:creator>
		<pubDate>Wed, 13 Aug 2008 07:32:34 +0000</pubDate>
		<guid>http://www.php-scripts.com/20060714/89/#comment-89247</guid>
		<description>for readability:

$color = dechex(rand(0,15)) . dechex(rand(0,15)) . dechex(rand(0,15)) . dechex(rand(0,15)) . dechex(rand(0,15)) . dechex(rand(0,15));</description>
		<content:encoded><![CDATA[<p>for readability:</p>
<p>$color = dechex(rand(0,15)) . dechex(rand(0,15)) . dechex(rand(0,15)) . dechex(rand(0,15)) . dechex(rand(0,15)) . dechex(rand(0,15));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeremy</title>
		<link>http://www.php-scripts.com/20060714/89/#comment-89246</link>
		<dc:creator>jeremy</dc:creator>
		<pubDate>Wed, 13 Aug 2008 07:31:15 +0000</pubDate>
		<guid>http://www.php-scripts.com/20060714/89/#comment-89246</guid>
		<description>Steve is right, but it might be easier to divide it into 6 numbers 0 - F, since only the first zero is the problem, and there's really no reason to subdivide a six digit number into three groups of two (unless you later want to have the ability to work with individual RGB color values). By concatenating the random one-digit zero, it stays put. I.e., 07 = 7, but 0 = 0 always.

$color = dechex(rand(0,15)).dechex(rand(0,15)).dechex(rand(0,15)).dechex(rand(0,15)).dechex(rand(0,15)).dechex(rand(0,15));

(Note that "15" is 16 digits including zero, the same way that 255 is 256 incl. zero.)

I'm sure you could further simplify it by dividing it into 1 (0-15) and 5 (0-1048575) digit random numbers.</description>
		<content:encoded><![CDATA[<p>Steve is right, but it might be easier to divide it into 6 numbers 0 - F, since only the first zero is the problem, and there&#8217;s really no reason to subdivide a six digit number into three groups of two (unless you later want to have the ability to work with individual RGB color values). By concatenating the random one-digit zero, it stays put. I.e., 07 = 7, but 0 = 0 always.</p>
<p>$color = dechex(rand(0,15)).dechex(rand(0,15)).dechex(rand(0,15)).dechex(rand(0,15)).dechex(rand(0,15)).dechex(rand(0,15));</p>
<p>(Note that &#8220;15&#8243; is 16 digits including zero, the same way that 255 is 256 incl. zero.)</p>
<p>I&#8217;m sure you could further simplify it by dividing it into 1 (0-15) and 5 (0-1048575) digit random numbers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve H</title>
		<link>http://www.php-scripts.com/20060714/89/#comment-41770</link>
		<dc:creator>Steve H</dc:creator>
		<pubDate>Sun, 09 Sep 2007 01:40:46 +0000</pubDate>
		<guid>http://www.php-scripts.com/20060714/89/#comment-41770</guid>
		<description>Handy code but you have a problem if rand returns 16 or less as the HEX will then only be one character long, breaking the color. You can either choose to str_pad each one like so:

str_pad(dechex(rand(0,255)),1,dechex(rand(0,16)))

or, a bit less bulky, you can just set the lower limit to 17:

dechex(rand(17,255))

That way you don't get a true random color as the lower values will never come out. But not having the darkest of colors can also work out for the best, especially when using it as a background color.</description>
		<content:encoded><![CDATA[<p>Handy code but you have a problem if rand returns 16 or less as the HEX will then only be one character long, breaking the color. You can either choose to str_pad each one like so:</p>
<p>str_pad(dechex(rand(0,255)),1,dechex(rand(0,16)))</p>
<p>or, a bit less bulky, you can just set the lower limit to 17:</p>
<p>dechex(rand(17,255))</p>
<p>That way you don&#8217;t get a true random color as the lower values will never come out. But not having the darkest of colors can also work out for the best, especially when using it as a background color.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BlaqueSheepe</title>
		<link>http://www.php-scripts.com/20060714/89/#comment-1726</link>
		<dc:creator>BlaqueSheepe</dc:creator>
		<pubDate>Fri, 18 Aug 2006 13:33:42 +0000</pubDate>
		<guid>http://www.php-scripts.com/20060714/89/#comment-1726</guid>
		<description>will this be able to call upon a certain (set of colors) if certain variables are entered. I'm working on a site and i need help for backend coding</description>
		<content:encoded><![CDATA[<p>will this be able to call upon a certain (set of colors) if certain variables are entered. I&#8217;m working on a site and i need help for backend coding</p>
]]></content:encoded>
	</item>
</channel>
</rss>

