How to set default Fill to a gradient using scripting?
Hello everyone,
I want to write a script that for whatever fill color I have selected, it would create a gradient that goes from 100% to 0% of that same color. I kinda successfully done it with the help of chatGPT, but the code keeps on creating new gradient swatches every time, piling up in the swatches panel.
Is there a way to place the gradient directly into the defaultFill without using swatches? I tried giving the swatch a name, and then deleting it before recreating another with the same name, but that also removes the color from items using it (they turn to black). Weirdly enough, when I delete the swatch from the UI, that doesn't do that.
Any help would be appreciated...
