Beta carotene is one of the orange dyes found in most green leaves, and in carrots. When leaves lose their chlorophyll in the fall, carotene is one of the colors left over in the leaf.
Beta carotene is used in foods to provide color (margarine would look as white as shortening without it). Another similar molecule, annatto is used in cheeses, and another famous carotenoid dye, saffron is used to color rice and other foods.
Beta carotene is sometimes added to products for its anti-oxidant effects, to keep fats from going rancid.
The body turns it into Vitamin A, and beta carotene is sometimes added to foods or vitamin supplements as a nutrient.
The same long chains of conjugated double bonds (alternating single and double bonds) that give the carotenes their colors are also the reason they make good anti-oxidants. The can mop up oxygen free radicals and dissipate their energy.
Annother colorful carotene is lycopene.
This is the red molecule that gives ripe tomatoes their color.
Notice the alternating double and single bonds between the carbon atoms. These are called "conjugated" bonds, or "resonance" bonds. The electrons in those bonds are not locked onto one atom, but spend their time bouncing from atom to atom. This gives the effect of something in between a double bond and a single bond, more of a one and a half bond.
The long chain of conjugated bonds acts like a wire, allowing the electrical energy to move from one side of the molecule to the other. The energy can slosh around like water in a bathtub.
Normally it takes quite a bit of energy to move an electron away from an atom. X-rays, or high-energy ultraviolet light can move an electron into a higher orbit in an atom, but ordinary visible light does not have enough energy.
A molecule of lycopene can absorb blue light because the electrons are not orbiting a single atom, they are sloshing around orbiting many atoms, and the energy needed to move them is a lot less than in a smaller molecule, or one without conjugated bonds.
You can think of the energy in a lycopene molecule as a wave sloshing in a bathtub, or the wave you can make with a jump rope. The lowest energy state (called the "ground" state) would correspond to the jump rope going around in the normal fashion.
Each end of the jump rope is a "node", a place where the rope doesn't move. It is possible to get a jump rope to have three nodes, as you may have done as a child. It acts like there are two jump ropes, each one half the length of the other.
The energy sloshing around in the lycopene molecule can do the same thing. Absorbing a photon of green light makes it act as if the molecule were two molecules, each half as long.
The molecule has absorbed the green light. White light that is missing its green light looks red. Beta carotene absorbs blue light, so it looks orange.
Another class of colored compounds are the anthocyanins. These molecules give color to flowers, blueberries, apples, and red cabbage. Anthocyanins are in the group of compounds known as flavenoids.
Anthocyanins can change their color, depending on how acid or alkaline they are.
In neutral conditions, the molecule has no charge. It absorbs yellow light, and appears purple. Notice all of the alternating single and double bonds.
In an acid (pH less than 3), the acid donates a hydrogen nucleus, and the molecule becomes positive. The bond next to the oxygen becomes a double bond, and the molecule now absorbs green light, so it appears red.
In an alkaline solution, the molecule donates a hydrogen nucleus, and a hydroxyl group becomes an oxygen atom with a negative charge. The molecule now absorbs orange light, and appears blue.
You can try this yourself at home. You need some purple grape juice, blueberry juice, or the water left over after boiling a red cabbage.
If you add clear distilled vinegar, the juice will turn red.
If you add baking soda, the juice will turn blue.
You can learn more about molecules that absorb different colors in the section on PABA.
beta carotene: InChI=1/C40H56/c1-31(19-13-21-33(3)25-27-37-35(5)23-15-29-39(37,7)8)17-11-12-18-32(2)20-14-22-34(4)26-28-38-36(6)24-16-30-40(38,9)10/h11-14,17-22,25-28H,15-16,23-24,29-30H2,1-10H3/b12-11+,19-13+,20-14+,27-25+,28-26+,31-17+,32-18+,33-21+,34-22+