Pesto can turn brown when left exposed to air. To avoid this, add a thin layer of olive oil on top before sealing it in an airtight container. This will help preserve the vibrant green color for about a week.