A sphere rotates smoothly along three axes with angles determined by B-splines. Three colour gradients X, Y and Z are created with exponential smoothing. The colour of a point on the sphere is the sum of the three gradient values corresponding to its rotated x, y and z positions. Pen drawing with high opaqueness creates a bit of a fluid effect. Maths: https://en.wikipedia.org/wiki/Rotation_matrix https://en.wikipedia.org/wiki/B-spline https://en.wikipedia.org/wiki/Exponential_smoothing
Check out Scratch Cat on a rolling marble using similar logic: https://scratch.mit.edu/projects/1307108789/