"Eat the rainbow" gets repeated so often it can start to sound like a slogan you nod at and forget. It's more useful as a plain shopping habit: when you fill the cart, aim to pick produce across a few different colors rather than three versions of the same one. The color isn't magic, but it's a handy shorthand for variety.
The reason this works is that different colored fruits and vegetables tend to come from different plants with different things to offer, so a colorful basket is usually a varied one almost by default. You don't have to memorize what each hue contributes; you just have to avoid a cart that's all one shade of beige or green.
In practice, give yourself a loose target at the shop — say, something red or orange, something deep green, something purple or blue, and something pale like cauliflower or onion. It's a quick mental checklist you can run while you walk the produce section, no list required.
Season ties into this naturally, since the available colors shift through the year. Leaning on what's in season keeps the rotation fresh and affordable, and it stops the rainbow from becoming a rigid rule that has you chasing out-of-season produce at a premium.
Frozen and tinned produce count toward the color spread too, which matters for keeping it realistic. A bag of frozen peas, some tinned tomatoes, frozen berries — these all add color and variety on the days the fresh shelf is bare or the budget is tight.
Make it a habit at the point of buying rather than a calculation at the table. If the cart goes in colorful, the week's plates tend to come out varied on their own, and that's the entire point — variety you set up at the shop so you don't have to engineer it later.