qayfhw
Last Updated: September 09, 2019
·
5.803K
· joseph_carney

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)];

1 Response
Add your response

2895

Thanks

over 1 year ago ·