defmech defmech - 5 months ago 18
iOS Question

How to get RGB values from UIColor?

I'm creating a color object using the following code.

curView.backgroundColor = [[UIColor alloc] initWithHue:229 saturation:40 brightness:75 alpha:1];


How can I retrieve RGB values from the created color object?

Answer
const CGFloat* colors = CGColorGetComponents( curView.backgroundColor.CGColor );

These links provide further details:

Comments