The file https://opengrok.libreoffice.org/xref/core/odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.java contains an example how to apply a gradient to a shape. That file needs an update or a new example needs to be added, now that multicolor gradients are possible. Affected is the struct Gradient2 and the struct ColorStop, see SDK API Reference.
Confirmed, thanks Regina.