Change ColourGradient stop positions

It looks like there's no easy way to change the position of existing stops in ColourGradient. There's a setColour function but no setPosition function. Is it that way on purpose?

I tried removing a stop and re-adding it with a new position but it isn't possible to remove the first stop.

No, the ColourGradient class is very much designed to be created, used once, then deleted. It's not the kind of thing you should use to store long-term state.