13. Oktober 2010
STEP 1: Copy the following blue text into your .h file:#import <UIKit/UIKit.h> // COLOR: Use HEX instead of RGB #define UIColorFromRGBWithAlpha(rgbValue,a) [UIColor \ colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]--------- STEP 2: In the .m file this is accessible just like in the following to sample lines:
label.textColor = UIColorFromRGBWithAlpha(0xffff00,1.0); label.backgroundColor = UIColorFromRGBWithAlpha(0x333333, 0.8);