<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>trickeries! &#187; png</title>
	<atom:link href="http://trickeries.com/tag/png/feed/" rel="self" type="application/rss+xml" />
	<link>http://trickeries.com</link>
	<description>it's tricky to rock a style thats liked online</description>
	<lastBuildDate>Tue, 02 Mar 2010 06:01:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pixler: a transparent PNG pixel generator</title>
		<link>http://trickeries.com/252/pixler-a-transparent-png-pixel-generator/</link>
		<comments>http://trickeries.com/252/pixler-a-transparent-png-pixel-generator/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 10:40:13 +0000</pubDate>
		<dc:creator>atom</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[pixler]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[toy]]></category>

		<guid isPermaLink="false">http://trickeries.com/?p=252</guid>
		<description><![CDATA[I made a weensy little script for the theme I recently made (which I still have not named or prepared for distribution) which will generate single pixel transparent pngs to use as tiled background images in css.
demonstration toy

&#60;?php    
&#160;
	$p = imagecreatetruecolor&#40;1, 1&#41;;
	imagesavealpha&#40;$p, true&#41;;
	$o = &#40;100 - &#40;int&#41; $_GET&#91;'o'&#93;&#41; * 1.27;
	$c = imagecolorallocatealpha&#40;$p, [...]]]></description>
			<content:encoded><![CDATA[<p>I made a weensy little script for the theme I recently made (which I still have not named or prepared for distribution) which will generate single pixel transparent pngs to use as tiled background images in css.</p>
<h2><a href="http://trickeries.com/demo/pixler/">demonstration toy</a></h2>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #FF00FF; font-weight: bold;">&lt;?php</span>    
&nbsp;
	<span style="color: #00FF00;">$p</span> <span style="color: #339933;">=</span> <span style="color: #0066FF;">imagecreatetruecolor</span><span style="color: #FF6600;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #0066FF;">imagesavealpha</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$p</span><span style="color: #339933;">,</span> <span style="color: #FF6600; font-weight: bold;">true</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #00FF00;">$o</span> <span style="color: #339933;">=</span> <span style="color: #FF6600;">&#40;</span><span style="color: #cc66cc;">100</span> <span style="color: #339933;">-</span> <span style="color: #FF6600;">&#40;</span>int<span style="color: #FF6600;">&#41;</span> <span style="color: #00FF00;">$_GET</span><span style="color: #FF6600;">&#91;</span><span style="color: #0000ff;">'o'</span><span style="color: #FF6600;">&#93;</span><span style="color: #FF6600;">&#41;</span> <span style="color: #339933;">*</span> <span style="color:#800080;">1.27</span><span style="color: #339933;">;</span>
	<span style="color: #00FF00;">$c</span> <span style="color: #339933;">=</span> <span style="color: #0066FF;">imagecolorallocatealpha</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$p</span><span style="color: #339933;">,</span> <span style="color: #FF6600;">&#40;</span>int<span style="color: #FF6600;">&#41;</span> <span style="color: #00FF00;">$_GET</span><span style="color: #FF6600;">&#91;</span><span style="color: #0000ff;">'r'</span><span style="color: #FF6600;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #FF6600;">&#40;</span>int<span style="color: #FF6600;">&#41;</span> <span style="color: #00FF00;">$_GET</span><span style="color: #FF6600;">&#91;</span><span style="color: #0000ff;">'g'</span><span style="color: #FF6600;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #FF6600;">&#40;</span>int<span style="color: #FF6600;">&#41;</span> <span style="color: #00FF00;">$_GET</span><span style="color: #FF6600;">&#91;</span><span style="color: #0000ff;">'b'</span><span style="color: #FF6600;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #00FF00;">$o</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #0066FF;">imagefill</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$p</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #00FF00;">$c</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #0066FF;">header</span><span style="color: #FF6600;">&#40;</span><span style="color: #FF0000;">&quot;Content-type: image/png&quot;</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #0066FF;">imagepng</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$p</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h2>usage / parameters:</h2>
<dl>
<dt>r</dt>
<dd>how much red to include: r=[0-255]</dd>
<dt>g</dt>
<dd>how much green to include: g=[0-255]</dd>
<dt>b</dt>
<dd>how much blue to include: b=[0-255]</dd>
<dt>o</dt>
<dd>how opaque the pixel should be: o=[0(fully transparent)-100(fully opaque)]</dd>
</dl>
<h2>so&#8230;</h2>
<dl>
<dt>pixler.php?r=255&amp;g=255&amp;b=255&amp;o=50</dt>
<dd>will make a white pixel that is 50% visible.</dd>
<dt>pixler.php?r=255&amp;o=100</dt>
<dd>will make a red pixel that is fully visible.</dd>
<dt>pixler.php</dt>
<dd>calling the script with no parameters will create an invisible black pixel (&#8230;).</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://trickeries.com/252/pixler-a-transparent-png-pixel-generator/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
