Skip to content

UIColor colorFromHex?

January 24, 2012

Don’t get me wrong. I love the Cocoa and iOS frameworks, but seriously, how could Apple still not have a method that returns color based on hex code. Web designers use them a lot, especially in CSS. And so when those designers pass the specs on to us developers, we always have to go through the process of calculating the RGB values.

Well enough of that, here is a category for UIColor which adds a class and instance method that returns a color based on its hex code.

My Gist: https://gist.github.com/1656060 https://gist.github.com/1673195

Advertisements

From → Development, iOS

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: