The purpose of red no. 40 — and all synthetic dyes — is to create distinct, uniform colors in consumable products. They're great for fun, eye-catching foods like cake mixes, frostings, and soft drinks. They're commonly added by large-scale food manufacturers but can also be used in home cooking.