1. Beware of acid. Acids like lemon juice and vinegar are the bane of chlorophyll, and will turn bright green vegetables olive drab in no time. Plenty of pesto recipes call for lemon juice or vinegar, and while they might enhance the taste, they’ll kill the color.
2. Consider blanching. Most pesto recipes don’t call for this step, but it makes a huge difference. If color matters to you, you’ll be happy you took the time. Blanch your basil (or spinach, cilantro, watercress, or whatever the base of your pesto is) for about 5 seconds in salted boiling water. Shock it in ice water for about 30 seconds. Squeeze it dry; continue with the recipe. This process intensifies and then sets the color. Your pesto will now stay bright green considerably longer than an unblanched version.
3. Wrap it right. When the pesto is in a storage container, don’t just seal it with plastic wrap or a lid. Press plastic wrap down onto the surface of the pesto, and smooth out any air bubbles. Then seal the container with a lid or plastic wrap. The wrap on the pesto’s surface will help keep it from oxidizing and turning brown.
Check out this recipe for Classic Pesto. And add the blanching step, if you like. Green is good, folks.