First of all, if you've got a sphere in deep space, its shadow side is going to be pure black, since there's pretty much no light bouncing around, and so there's no light to be reflected by the shadow side of the sphere. Now let's take an indoors scene: Imagine a room with red walls, a white floor, a single neutral (white light) ceiling lamp and a white sphere in the middle, what color is the sphere's shadow going to be? In the red-walled room, the shadows of the sphere would be subtly red — especially in the parts of the shadow where it's facing the walls more than the floor. That's because the light you see in the shadows of an object is light that has already been reflected from other surfaces in the room. This reflected light, in the case of the red walls, is red.
Of course in a more complicated scene you just approximate it. For an outside scene, you usually want to make your shadows only a bit darker and move your shadow color's hue a little closer to the color of the sky. But colors are difficult, you learn through experience really.
The surface reflects light it scoops up from the visible hemisphere around it. If some of the hemisphere is sky, then the light cast onto that surface will be tinted blue.
I'm not sure if people have access to it, but here's an example from an airborne imaging spectrometer that is flying over a partially-shadowed domed building (on the Caltech campus):
https://www.sciencedirect.com/science/article/pii/S003442572...
Figure 4 shows the dome (really a cone) - note the shadow at top-right.
And figure 5, panel C, shows the contrast-enhanced light reflecting off that dome. You can see that the shadowed portion in the upper-right of the dome is bluer than the directly-lit stuff. (The directly-lit stuff is more golden, from the direct sunlight.)
As you imply, the outcome is not always realistic. The reason is that the shadow would be tinted by the environment light. This is particularly apparent in desert environments or very sunny environments where the shadows can be a saturated blue.
An art teacher would tell you to paint from real life and look into the shadows and try to perceive the colors that are there. Paint those. Don't treat it as a chemistry problem.
But if you're wondering why Maxfield Parrish painted orange rocks with indigo shadows it's because in the absence of direct light (in the shadows) ambient light will fill in. And the sky, as an example, is a giant blue ambient light reflector, the grass a giant green one.