Pearls may appear to change color in different lighting or next to different colors. This is due to the highly reflective nature of their nacre. It makes them particularly fascinating because they look different from different angles or with different outfits according to the lighting.
To know what color your pearls really are, don't hold them in direct sunlight, but rather near a window on a slightly overcast day. Natural light will show their colors well, but direct sunlight is too bright and some of the more subtle colors won't be perceived.
When buying pearls, put the pearls on a white background to view them as this helps to see the subtle variations of color. Wipe off fingerprints with a soft cloth before choosing the pearls as even fingerprints can slightly alter the perception of the colors.
Much of the information regarding pearl color found on the Akoya Pearl Colors Guide
applies to other types of pearls as well. It's worth having a look.
Do pearls change color as they age? Yes, over the years white pearls can gradually yellow if they are exposed to heat. Keep them away from sources of heat. Usually pearls that have yellowed with age are either very, very old or haven't been properly cared for.