I would like to set custom color programmatically using the method
[UIColor colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha];
For which i need to know the value of RBG components.
I would like to know is there any way by which i can get the RBG components of a custom color so that i can use them in the above mentioned method.
I would like to set custom color programmatically using the method [UIColor colorWithRed:(CGFloat)red green:(CGFloat)green
Share
You can use the DigitalColor Meter.app included with every Mac OS X install. You can find it in
~/Applications/Utilities/DigitalColor Meter.app. Use it to inspect the RGB values of any pixel you mouse over. Once you have the values, you just need to divide them by255.0because+colorWithRed:green:blue:alpha:is expecting a floating point value between 0 and 1.