I have an UIColor object that will be the color for a bar in a bar chart graph. I would like to make this color into a linear gradient that will go from the color to a lighter version of that color and back to the initial color. I think CGGradientCreateWithColorComponents is the function for this but I’m not sure how to use it … How do I obtain the lighter version of my color ? and use it in the gradient. I’m fairly new to core graphics .
Thanks …
I use
CAGradientLayerin the Quartz Core framework. It accepts an array ofCGColorRefcolors that can be used to form a gradient. Some example code is displayed below for handling aUIColorincolor. You can modify the brightness or other HSB parameters to achieve what you want.