and you dont even need CAGradientLayers. CGContext handles all that stuff nicely and fast and transparent everywhere a Xojo graphics object is present.
Nothing wrong with hand-made gradients like above. Only that you waste a lot of CPU cycles on things that the OS does much faster with GPU support.
One who compiled that stuff for macOS and iOS and worked on cleaning that collection must now admit he is uncertain when it can be released again due to the upcoming changes regarding API 2.0