<?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>benwatts.ca &#187; colour</title>
	<atom:link href="http://benwatts.ca/tag/colour/feed/" rel="self" type="application/rss+xml" />
	<link>http://benwatts.ca</link>
	<description>Designer and Frontend Developer in Ottawa, Canada</description>
	<lastBuildDate>Fri, 22 Jul 2011 19:00:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Orange!</title>
		<link>http://benwatts.ca/2009/orange/</link>
		<comments>http://benwatts.ca/2009/orange/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 01:35:14 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[orange]]></category>
		<category><![CDATA[wallpaper]]></category>

		<guid isPermaLink="false">http://www.benwatts.ca/?p=370</guid>
		<description><![CDATA[It&#8217;s Spring, but everything is still dead outside. I needed to do something that seemed at least a teensy-bit lively: FAKE BOKEH! 1680&#215;1050 @ flickr or deviantart. Oh, at the risk of further shaming myself on the internets: this contains both a PS Lens Flare and at one point, gratuitous use of Liquify. That&#8217;s right: Lens [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s Spring, but everything is still dead outside. I needed to do something that seemed at least a teensy-bit lively:</p>
<p><a title="Orange by benwatts, on Flickr" href="http://www.flickr.com/photos/benwatts/3403346664/"><img src="http://farm4.static.flickr.com/3420/3403346664_3108783cf1.jpg" alt="Orange" width="500" height="313" /></a></p>
<p>FAKE BOKEH!<br />
1680&#215;1050 @ <a href="http://www.flickr.com/photos/benwatts/3403346664/sizes/o/">flickr</a> or <a href="http://nuked-whale.deviantart.com/art/Orange-117733954">deviantart</a>.</p>
<p>Oh, at the risk of further shaming myself on the internets: this contains both a PS Lens Flare and at one point, gratuitous use of Liquify. That&#8217;s right: <em>Lens Flare</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://benwatts.ca/2009/orange/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tinting a Display Object</title>
		<link>http://benwatts.ca/2008/tinting-a-display-object/</link>
		<comments>http://benwatts.ca/2008/tinting-a-display-object/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 17:29:35 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[tinting]]></category>

		<guid isPermaLink="false">http://seaturtle.rainiscold.ca/?p=56</guid>
		<description><![CDATA[Tinting a display object in AS3 is remarkably easy: // EXAMPLE 1: tint a display object import fl.motion.Color; // [..] var tint:Color = new Color&#40;&#41;; tint.setTint&#40; 0x0099ff, 1 &#41;; myobject.transform.colorTransform = tint; You&#8217;ve got two options for resetting the colour, store the original colour or create a new Color object. The following example resets the [...]]]></description>
			<content:encoded><![CDATA[<p>Tinting a display object in AS3 is remarkably easy:</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900; font-style: italic;">// EXAMPLE 1: tint a display object</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>motion<span style="color: #000066; font-weight: bold;">.</span>Color<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #009900; font-style: italic;">// [..]</span><br />
<span style="color: #6699cc; font-weight: bold;">var</span> tint<span style="color: #000066; font-weight: bold;">:</span>Color = <span style="color: #0033ff; font-weight: bold;">new</span> Color<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
tint<span style="color: #000066; font-weight: bold;">.</span>setTint<span style="color: #000000;">&#40;</span> 0x0099ff<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
myobject<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">transform</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">colorTransform</span> = tint<span style="color: #000066; font-weight: bold;">;</span></div></div>
<p>You&#8217;ve got two options for resetting the colour, store the original colour or create a new Color object. The following example resets the colour of a display object when it is hovered over.</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900; font-style: italic;">// EXAMPLE 2: reset with a new Color Object</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>motion<span style="color: #000066; font-weight: bold;">.</span>Color<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MouseEvent</span><span style="color: #000066; font-weight: bold;">;</span> <br />
<span style="color: #009900; font-style: italic;">// [..]</span><br />
<br />
<span style="color: #009900; font-style: italic;">// call the hover() function when we hover over the display object:</span><br />
myobject<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ROLL_OVER</span><span style="color: #000066; font-weight: bold;">,</span> hover<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <br />
<br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> hover<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentTarget</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">transform</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">colorTransform</span> = <span style="color: #0033ff; font-weight: bold;">new</span> Color<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// removes tint</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>Alternatively, you can store the original &#8220;colour&#8221; of the untinted in a variable <strong>before </strong>you tint it. The following trivial example demonstrates this, but you wouldn&#8217;t see any visible change on the stage (FYI).</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900; font-style: italic;">// EXAMPLE 3: reset the tint by storing the original value</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>motion<span style="color: #000066; font-weight: bold;">.</span>Color<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #009900; font-style: italic;">// [..]</span><br />
<span style="color: #6699cc; font-weight: bold;">var</span> tint<span style="color: #000066; font-weight: bold;">:</span>Color = <span style="color: #0033ff; font-weight: bold;">new</span> Color<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
tint<span style="color: #000066; font-weight: bold;">.</span>setTint<span style="color: #000000;">&#40;</span> 0x0099ff<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
<span style="color: #6699cc; font-weight: bold;">var</span> originalColour<span style="color: #000066; font-weight: bold;">:</span>Color = myobject<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">transform</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">colorTransform</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// store the original colour.</span><br />
<br />
myobject<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">transform</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">colorTransform</span> = tint<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// tint the object blue</span><br />
myobject<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">transform</span><span style="color: #000066; font-weight: bold;">.</span>colourTransform = originalColour<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// tint the object back to its original colour</span></div></div>
<p><!--http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/motion/Color.html#tintColor--></p>
]]></content:encoded>
			<wfw:commentRss>http://benwatts.ca/2008/tinting-a-display-object/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

