As the Apollo astronauts observed 40 years ago today, cast shadows are nearly black on the moon, because the sky above the moon’s surface is nearly black.
I say “nearly” because there’s a little bit of starlight and there’s a little bit of reflected light trickling into moonshadows.
On Earth cast shadows are flooded by various sources.
To understand those sources, try to imagine yourself as a little eyeball mounted on an the back of an ant. As you walk across the shadow, imagine yourself looking around at all the bright patches of light shining down on you, not just the blue sky, but also white clouds, buildings, or other bright objects. Those patches of light determine the brightness and color temperature of your shadow.
Here’s a shadow cast across a rooftop by a dormer. An ant walking across the shingles would look up and see a sky with high clouds. But he would also see a large white wall just off to the right, the illuminated side of the second dormer. That white patch is brighter than the sky, and it pours light into the right half of the shadow.
Beneath the photo are samples of two areas of the shadow. You can see how much the cast shadow changes as the sources of infilling light change in relative intensity.
On Earth, cast shadows tend to be blue only because they’re normally thrown across surfaces that look up to the blue of the sky. But be aware the ant doesn’t always see blue patches. On overcast days, the fill light is white. And sometimes the sky patch is small and other patches are bigger and stronger.