When the brain is trying to make sense of visual information in diagrams, it is easier to detect similarities or variations in color and shade than to detect shapes. So for a beginning learner, it's helpful to use the assistance of a color code when trying to figure out which organelle is a mitochondrion in a diagram (its pink) and which organelle is a nucleus (its purple).
Likewise, it's not hard to figure out which side of a (blue) cellular membrane is intracellular if that region is always represented in yellow and which side is extracellular if that side is always represented in light blue.
Using a consistent color code for key structures reduces the cognitive load of interpreting diagrams. It thus allows the reader to spend most of their "mental energy" on the main idea of the diagram—rather than get bogged down in trying to figure out all the little parts of the diagram first.
It's only after a student has become familiar with the microscopic and gross terrain of the body that they can then start to recognize mitochondria, nuclei, intracellular spaces, and extracellular spaces by their locations and shapes. A color code helps students become competent faster by allowing them to learn in a step-wise fashion—much as using training wheels can shorten the time it takes to learn how to ride a bike.
In Anatomy & Physiology, we also tell the reader what we're doing by providing a comprehensive color key in the preface of the textbook. By revealing the strategy up front, a savvy reader can gain even more benefit from it by being mindful of the color-coding technique of learning as they use the textbook.