I thought this would be simple, but….
How can I get the backgroundcolor of a UILabel (preferably in RGB) ?
I can’t seem to find a method or a simple way to convert a UIColor to RGB.
Thanks.
EDIT:
I ended up using this code:
CGFloat r,g,b,a;
const float* colors=CGColorGetComponents(myLabel.backgroundColor.CGColor);
r=colors[0];
g=colors[1];
b=colors[2];
a=colors[3];
or pre-iOS 5: