In the Star Wars Original Trilogy, the only lightsaber colors are red, blue, and green. The Prequel Trilogy adds purple, but only for Mace Windu's lightsaber. The Expanded Universe, on the other hand, features a myriad of different lightsaber colors. Although these colors originally had meaning, in most Star Wars media they are merely decorative.
Lightsaber Colors in the Original Trilogy
In Episode IV: A New Hope, both Obi-Wan Kenobi's lightsaber and Anakin Skywalker's old lightsaber are blue, while Darth Vader's lightsaber is red. This functions as simple color coding to tell the good guys apart from the bad guys, much like the lasers from Imperial ships are green while the lasers from Rebellion ships are red.
In Episode VI: Return of the Jedi, Luke Skywalker constructs a new lightsaber. This was also meant to be blue, and appears as such in early trailers and posters for the film. However, it was changed to green to create a better color contrast during the scenes on Tatooine. This purely functional change both set Luke's lightsaber apart from the one he inherited from his father and opened the door for new lightsaber colors in the future.
Lightsaber Colors Expanded
In the Prequel Trilogy, Mace Windu's unique purple lightsaber was again was a functional change: Samuel L. Jackson, who played Windu, asked for a lightsaber to match his favorite color, and the distinct shade helped his character stand out on the battlefield from the red, blue, and green of the other lightsabers.
Even before the Prequels, however, the Star Wars Expanded Universe added more lightsaber colors. For example, a Dark Jedi in Dark Forces II: Jedi Knight wields a yellow lightsaber, Mara Jade wielded a purple lightsaber, and the lightsaber colors in the video game Knights of the Old Republic include cyan, silver, and orange. Later works added even more colors: The Force Unleashed, for example, features black, gold, and pink lightsabers.
The symbolism of lightsaber colors -- red for Sith, blue/green for Jedi -- is not so clear-cut in the Expanded Universe. Not only do Dark Jedi wield non-red lightsabers, but Jedi such as Adi Gallia (in the comics Star Wars: Republic) and Leia Organa Solo (in the Corellian Trilogy novels) wield red lightsabers.
Creating a Meaning for Lightsaber Colors
Even within the Star Wars universe, the meaning of lightsaber colors is not always certain. Jedi vs. Sith: The Complete Guide to the Force, for example, states that the idea of lightsaber colors reflecting their wielders' personalities is a "popular notion," but incorrect. Rather, lightsaber colors depend on the type of crystals used to create the blade.
According to The Jedi Path: A Manual for Students of the Force, lightsaber colors originally indicated a Jedi's role in the Order. For example, Jedi Consulars, who focused on non-violence, carried green lightsabers to symbolize peace. Jedi Guardians, on the other hand, carried blue lightsabers as a symbol of uniformity and solidarity. These symbolic colors began around 4,000 BBY. By 1,032 BBY, lightsaber colors were still associated with different types of Jedi, but were neither required nor exclusive. Kerra Holt in Knight Errant, for example, wields a green lightsaber despite having no association with the Jedi Consulars.
The in-universe explanation for the lack of lightsaber color variation in the movies is a lack of colored crystals. According to Jedi vs. Sith, the Empire quarantined or destroyed many sources of lightsaber crystals. This left the Jedi with mostly Ilum crystals, which can only produce green or blue blades. This explains neither the dearth of colors in the Prequels nor the unusual lightsaber colors in the Expanded Universe during the time of the Empire, but it's likely the best explanation fans will get.