Working with #HEX colours in xCode
Set up a #define and define each hex colour...
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define COLOR_ORANGE 0xFB9700
Insert it where you would normally use an UIColor...
[label setTextColor:UIColorFromRGB(COLOR_ORANGE)];
Written by Joe
Related protips
1 Response
Thanks
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ios
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#