This question is very old, and has many answers, but I went to art college. Here is my answer:
The theory as you have stated it, according to my knowledge, is only partially correct. In reality, the color of shadows are the complement of the color of the light source. If you think about it, it makes sense: a cast shadow can be defined as blocked light, and if you have for instance a yellow light (the sun) you will be left with a bluish cast shadow. To illustrate this point, please consider "The Green Stripe" by Matisse (someone who may be referred to as 'one of the old masters' or whatever):
link to google image search results for "The Green Stripe".
Please note how the red light, which is being cast from the right side of the frame, leaves a dark greenish core shadow and a yellowish reflected highlight. Green is the complement of magenta, and yellow is the sum or green and red (additive color theory).
Recall that the theory as you state it is partially correct! In close-up cases of brightly colored and reflective objects on a white surface, such as the image you linked with the apple, the ambient light in the room is hitting the dark side of the apple and reflecting the apple's color onto the surface on which it rests. The core color of the shadow is still the complement of the color of the light source!! In a studio environment (the kind of place where you find lone apples on white void-like surfaces), your light source is likely artificial and as close to pure white as possible so that people working with color and pigments in that environment do not have their understandings of color skewed due to a colorful light (try painting the same thing twice under sunlight and then in a photographic dark room (red)! compare those results lol).
Now! to answer your question: dynamic shadows, or even just statically colored shadows are extremely doable. Do they fall within the scope of your project with consideration to time, money, and labor required? Well that's a completely different question that you need to answer for yourself!! Gray/black shadows are a SIN (imo) and you should avoid them if you want your game to generally be considered aesthetically pleasing. You do not need to predict the background, environment, or take into account the object color. The only piece of info you need for easy and natural shadows is the color of the light source. Consider this screenshot from attack on titan: LINK
Shadows in my game are always a dark and desaturated complement of the color of my game's light source(s): RELATIVELY EASY, several games already do this
Shadows in my game take into account ambient occlusion, bounce light, the color of multiple light sources and types, etc. etc.? That's already a lot of gosh darn work. If you're an indie developer whose primary focus is making games rather than graphics programming or tools dev, this is absolutely not worth your time (opinion).
Thanks for reading, hope this helps whoever visits this ancient problem in the future!!! :- )