If you want to freeze your pesto or in general, want to keep it nice and green, then blanch it in boiling water for about 60 seconds. Drain on paper towels and then follow remaining steps. (optional) Nice way to have fresh pesto in the winter.
Put basil, garlic, salt and pepper into a food processor or blender and mix. Scrape the sides, add walnuts and cheese and blend some more. Add some oil while machine is running (about 1/2). Taste. Add more salt and pepper if needed. Add more oil while machine is running until you get the right consistency. It should be about a medium paste and not too runny.
Another option is to mix part of the ingredients now, freeze it, and add the rest later. To do this, combine all ingredients except for nuts and cheese. Add nuts and cheese after thawing. I used to do this until I figured out how to just freeze the whole recipe. (see step one) otherwise it starts to turn a very dark green.
If you blanch your leaves for just a minute or two, your pesto will stay a bright green for much longer. Even after freezing.