rubymotion/BubbleWrap — pull request #66 by ecamacho (2012-06-14 19:34:03+00:00)
Title: Method color_from_hex to UIColor class

Hi,

I've added a method to create a UIColor from a Hex color represented by a String. I've always add a macro to do this to my CocoaTouch projects and I thought it'll be useful to have a pure Ruby implementation.

Usage:

@color = UIColor.color_from_hex("#FF8A19")

It also supports 3 digits colors that are valid in HTML:
@blue_color = UIColor.color_from_hex("#00F")

Regards
Erick