<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: UIColor Macros</title>
	<atom:link href="http://MobileDeveloperTips.com/cocoa/uicolor-macros.html/feed" rel="self" type="application/rss+xml" />
	<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html</link>
	<description>iOS and Objective-C Tips, Tricks and Tutorials.</description>
	<lastBuildDate>Sat, 19 May 2012 05:15:17 -0500</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Jacek Marchwicki</title>
		<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html#comment-61760</link>
		<dc:creator>Jacek Marchwicki</dc:creator>
		<pubDate>Tue, 25 Oct 2011 14:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2342#comment-61760</guid>
		<description>or:
#define RGB(r, g, b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1]
#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define HTML(rgb) RGB((double)(rgb &gt;&gt; 16 &amp; 0xff), (double)(rgb &gt;&gt; 8 &amp; 0xff), (double)(rgb &amp; 0xff))

then:
[label setTextColor:HTML(0xff0000)];</description>
		<content:encoded><![CDATA[<p>or:<br />
#define RGB(r, g, b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1]<br />
#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]<br />
#define HTML(rgb) RGB((double)(rgb &gt;&gt; 16 &amp; 0xff), (double)(rgb &gt;&gt; 8 &amp; 0xff), (double)(rgb &amp; 0xff))</p>
<p>then:<br />
[label setTextColor:HTML(0xff0000)];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Masilotti</title>
		<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html#comment-60010</link>
		<dc:creator>Joe Masilotti</dc:creator>
		<pubDate>Sat, 10 Sep 2011 19:22:34 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2342#comment-60010</guid>
		<description>Thanks so much for this, it&#039;s proven to be a huge time saver.

Genius!</description>
		<content:encoded><![CDATA[<p>Thanks so much for this, it&#8217;s proven to be a huge time saver.</p>
<p>Genius!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron Sweeney</title>
		<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html#comment-33342</link>
		<dc:creator>Ron Sweeney</dc:creator>
		<pubDate>Wed, 01 Dec 2010 14:15:41 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2342#comment-33342</guid>
		<description>very nice and clean...

I use this one I stumbled upon months ago...

https://gist.github.com/631616</description>
		<content:encoded><![CDATA[<p>very nice and clean&#8230;</p>
<p>I use this one I stumbled upon months ago&#8230;</p>
<p><a href="https://gist.github.com/631616" rel="nofollow">https://gist.github.com/631616</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff</title>
		<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html#comment-19685</link>
		<dc:creator>Geoff</dc:creator>
		<pubDate>Mon, 12 Jul 2010 03:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2342#comment-19685</guid>
		<description>I finally got it, thanks though. I had originally placed inside @interface and @end and then had deleted everything in the .h minus the #define. I added a new file with #define inside @protocol and @end and included that .h wherever needed.

The next problem I ran into was that the color change was not visible at runtime. I had to move my code to set the cell background color from cellForRowAtIndexPath to willDisplayCell, then it showed up as expected.

Thanks again, and nice macro.</description>
		<content:encoded><![CDATA[<p>I finally got it, thanks though. I had originally placed inside @interface and @end and then had deleted everything in the .h minus the #define. I added a new file with #define inside @protocol and @end and included that .h wherever needed.</p>
<p>The next problem I ran into was that the color change was not visible at runtime. I had to move my code to set the cell background color from cellForRowAtIndexPath to willDisplayCell, then it showed up as expected.</p>
<p>Thanks again, and nice macro.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Muchow</title>
		<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html#comment-19683</link>
		<dc:creator>John Muchow</dc:creator>
		<pubDate>Mon, 12 Jul 2010 03:05:35 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2342#comment-19683</guid>
		<description>Geoff,

You should be able to copy the definitions into a .h file that you include wherever needed. Something else may be amiss, as I just copy/pasted the defines into a source file with no errors. If you remove the definitions does your app compile as expected?</description>
		<content:encoded><![CDATA[<p>Geoff,</p>
<p>You should be able to copy the definitions into a .h file that you include wherever needed. Something else may be amiss, as I just copy/pasted the defines into a source file with no errors. If you remove the definitions does your app compile as expected?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff</title>
		<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html#comment-19666</link>
		<dc:creator>Geoff</dc:creator>
		<pubDate>Mon, 12 Jul 2010 00:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2342#comment-19666</guid>
		<description>Thanks that fixed the compiler problem. However next it tells me that I&#039;m implicitly defining that function when I go to use it. I assumed that placing it in a random .h file anywhere would make it globally available. When that turned out incorrect I tried including the .h file but that didn&#039;t work either. I guess I just need to research how to use #define statements in terms of where to place them and how to reuse across multiple files.</description>
		<content:encoded><![CDATA[<p>Thanks that fixed the compiler problem. However next it tells me that I&#8217;m implicitly defining that function when I go to use it. I assumed that placing it in a random .h file anywhere would make it globally available. When that turned out incorrect I tried including the .h file but that didn&#8217;t work either. I guess I just need to research how to use #define statements in terms of where to place them and how to reuse across multiple files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Muchow</title>
		<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html#comment-18934</link>
		<dc:creator>John Muchow</dc:creator>
		<pubDate>Mon, 05 Jul 2010 22:31:12 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2342#comment-18934</guid>
		<description>Geoff,

Did you try the macro definitions all on one line (I split the lines so they would fit on the post without scrolling)?</description>
		<content:encoded><![CDATA[<p>Geoff,</p>
<p>Did you try the macro definitions all on one line (I split the lines so they would fit on the post without scrolling)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff</title>
		<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html#comment-18800</link>
		<dc:creator>Geoff</dc:creator>
		<pubDate>Sun, 04 Jul 2010 19:18:55 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2342#comment-18800</guid>
		<description>Where do you paste the macro in at?  I tried after my import statements in my app delegate and I get compiler errors:

error: expected identifier or &#039;(&#039; before &#039;[&#039; token</description>
		<content:encoded><![CDATA[<p>Where do you paste the macro in at?  I tried after my import statements in my app delegate and I get compiler errors:</p>
<p>error: expected identifier or &#8216;(&#8216; before &#8216;[&#8216; token</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gonzobrains</title>
		<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html#comment-12763</link>
		<dc:creator>gonzobrains</dc:creator>
		<pubDate>Wed, 07 Apr 2010 04:25:48 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2342#comment-12763</guid>
		<description>just what the iPhone doctor ordered!  thanx for this one, dude!</description>
		<content:encoded><![CDATA[<p>just what the iPhone doctor ordered!  thanx for this one, dude!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lawrence</title>
		<link>http://MobileDeveloperTips.com/cocoa/uicolor-macros.html#comment-9685</link>
		<dc:creator>Lawrence</dc:creator>
		<pubDate>Wed, 17 Feb 2010 20:22:04 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2342#comment-9685</guid>
		<description>Thanks or this.  It was just what I needed!</description>
		<content:encoded><![CDATA[<p>Thanks or this.  It was just what I needed!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

