How to create a texture made out of multiple color layers
This is using a boolean difference modifier on the sphere. The texture nodes in Blender are 3D which means the sphere gradient texture contains information about the inside of the object the material is applied to.