How can I get the color in a gradient at a specific position in iOS 5?
I have a vertical bar with a gradient from red to green and on the left side is a triangle showing the position in the bar. How can I fill the triangle with the color of the bar at that position?
I think in Mac OS X it’s “interpolatedColorAtLocation” but how about iOS 5?
Thank you for help.
There’s no API for this in iOS. You’ll have to do the gradient interpolation yourself, or draw your gradient into a
CGBitmapContextand then find the pixel value in the bitmap’s raw data.