There are a few techniques you can use. First adding lemon juice helps the pesto from turning.   Also when storing the pesto add a thin layer of olive oil over the top or placing plastic wrap over the top. These methods keep the air from getting to the pesto. Lastly, blanching the basil leaves before preparing keeps it bright green.