Is it possible to give custom color codes to UIKit controls?
Either by passing hex color values or working with RGB values?
Just noticed in the documentation there is a initWithRed:green:blue:alpha: method
Any way of getting hex codes to work?
Is it possible to give custom color codes to UIKit controls?
Either by passing hex color values or working with RGB values?
Just noticed in the documentation there is a initWithRed:green:blue:alpha: method
Any way of getting hex codes to work?
A use of the following macro would allow me to accomplish what I am looking for
#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]
To change the color is just a matter of calling the macro
self.view.backgroundColor = UIColorFromRGB(0xFEBFBF);
Your other option is to convert your hex values to RGB and enter them in the interface builder.