I need to create custom gradients to apply to path fills. I'm working in Hot Door's CORE, though, so my code isn't exactly like the SDK, although I can still access the SDK in addition to the wonderfully simple and straightforward CORE classes. CORE doesn't support adding gradients to the swatches, however, and I have a feeling that's why I can't apply a gradient I created to a path's fill as an AIGradientStyle -- that the gradient is referenced from the AIGradientStyle, not copied into it, and so needs to exist long after my local variable disappears.
Although a CORE project can't run the "SnpGradient.cpp" snippet file, I've been studying it along with other headers to try to understand gradients. Getting and setting stops and their properties is no problem, but I'd really appreciate any advice regarding where and how to store the gradient itself, and to add to or reference it from the swatches. Thankfully, I can access the SDK directly for those things CORE doesn't address. Many thanks in advance!