When the pesto is exposed to air, oxidation (a chemical reaction) occurs and gives the pesto a brown color. To prevent this from happening you can blanch the basil leaves in boiling water for 5 seconds (not more) and dunk them in ice water right away. Pat the leaves dry before blending.