I have a draw board project that needs to draw a UIBezierPath
with multiple color.
I use method addLineToPoint()
to append my path and
resultColor.set()
path.stroke()
to draw the path every time after addLineToPoint
is called.All I want is each segment of the path have different color depend on the back ground color.I have already had the result color (different point has its color), but when I use the methods above when I drawing, the color of the whole path is changing to the latest point's result color , but I want is a path like this:
enter image description here
(assuming that it is a single UIBezierPath)
How can I deal with the problem?
Thanks a lot!