I am trying to attract a prism and animate it with CoreAnimation. But I can’t find a good solution to draw a fan of rainbow colors.

There are several ways to do this, each of them has disadvantages:
- I could just use an image. But I let the user zoom in on the scene, and I would like to avoid any artifacts.
- Use
CAGradientLayercreates a pleasant rainbow. Unfortunately, there is currently skew (or compression) to transform a rectangular rainbow into a triangle. - A simple oblique layer effect can be obtained by modifying the matrix transform matrix element m34. But I could not get the shape of a triangle (because the layer should have an infinite size).
- OpenGL. , , , .
?