I have a image that is pure white. It is the white at the center of the Mac color wheel. I want to increase the darkness of the white programmatically. (Non programmatically would be to slide the slider down)
I need a darker white, then darker than that, etc. How would I achieve this with code?
Generally, when dealing with colors programmatically, I prefer to use Hue, Saturation, and Brightness. It's much easier to progress colors using increments of each parameter.
UIColor provides a factory method
- (UIColor *)initWithHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha
Here's a link to the UIColor class reference and the above method.