Pasta is made with a dough that is kneaded and then fashioned into hundreds of different shapes and sizes. The dough normally is made of wheat or other grains. This results in a yellow-white colour. Other colours are obtained by adding natural colour extracts to the dough before drying.
The following colours are generally used:
Black pasta (pasta nera) is coloured with squid or cuttlefish ink, which turns it black.
Green pasta (pasta verde) is coloured with spinach.
Purple pasta (pasta viola) is coloured with tomatoes or beets.
Red pasta (pasta rossa) is coloured with carrots.
Orange pasta (pasta arancione) is coloured with different varieties of squash and pumpkin.
The colours do also provide some flavour to the pasta, but this flavour is normally masked by the sauces used.