Problem with rendering complex gradient in NanoVG

I decided to completely abandon the use of raster graphics in the GUI of the plug-ins being developed, replacing it with vector graphics. However, not everything turned out to be as good as we would like to see an elegant graphical interface.
The first trouble arose when using a complex linear gradient using NanoVG (there is no such problem with Skia).
As I later found out, the problem is hidden in the NanoVGPaint function.
Namely, in this place:

  NVGcolor icol = NanoVGColor(pattern.GetStop(0).mColor, pBlend);
  NVGcolor ocol = NanoVGColor(pattern.GetStop(pattern.NStops() - 1).mColor, pBlend);

That is, the implementation of a linear gradient implies only extreme points, ignoring intermediate ones.
The idea of splitting the path into several parts in accordance with the parts is gradient and coloring these sections separately is difficult to implement and, in my opinion, smacks of perversion.
Any other ideas?

This is a limitation of NanoVG unfortunately. We can’t fix in iplug2 unless the functionality of nanoVG is increased.

So the fix is to use skia. NanoVG is sometimes faster and produces smaller binaries (although you can improve this on Mac by setting a flag removing SVG code that takes up lots of space). Is there a reason skia is not good for you?

Another option is to do your gradient using a shader iPlug2/TestCustomShaderControl.h at master · iPlug2/iPlug2 · GitHub