Gemstones are formed naturally in the ground through millennia of geological activity. Many gemstones are actually derived from the same basic pure crystals, such as beryl or corundum but with different trace impurities of different elements they take on different colours, leading to the plethora of differently coloured gemstones we know and love.
Garnets have a range of colours, but red is the traditional colour for them in the jewellery world. There are many types of garnet which have an underlying silica based structure, with pyrope and the pink-red rhodalite garnet being the more commonly used for jewellery. The colour comes from trace elements in the crystal of rhodium or magnesium.
Topaz comes in many colours naturally, but blue topaz is rare in the natural world. Often, clear, grey or yellow topaz is heat treated to develop the blue colour it is known for in the jewellery trade and therefore, it can be made in several different shades depending on the intensity of the heat treatment. Topaz is one of the few gemstones which is a gemstone in its own right rather than a coloured variety of another mineral. Peridot is another rarity, as it only occurs in one colour and it is coloured that way because of magnesium impurities in the silicate crystal. It is sometimes called chrysolite.
Amethysts are a form of quartz coloured by iron impurities. There are many amethyst deposits around the world and they each vary in colour and clarity, depending on how they were formed and which minerals were present. Radiation exposure can turn clear quartz into amethyst, and applying heat treatment to a purple amethyst can turn it green. Citrine is also a form of quartz, but does not occur naturally except rarely in very pale yellow colours. It is most often coloured by heat treating amethyst or smoky quartz until the desired colour is achieved.
Aquamarine and emeralds are forms of beryl, an otherwise colourless crystal. Iron traces create the delicate blue colour of aquamarine, although it can be heat treated to deepen the colour. Emeralds are coloured by traces of chromium and vanadium, while iron lends a subtle blue tone to some emerald deposits. Sapphires, also blue, are a coloured variety of corundum. Traces of iron, copper, chromium and titanium give the stone its blue colour, although pink sapphires contain more chromium which gives them their unique colour. Rubies are another distinct variety of corundum and get their rich red colour from chromium, and are sometimes confused with pink sapphires due to their proximity in colour and geological source.
So, there you have it. Gemstones get their colour from a range of sources, either naturally occurring impurities or trace elements in the crystam structure or from heat or radiation treatment of other stones. Some colours are extremely rare, such as pink sapphires or naturally blue topaz and some stones are more common, being produced from large deposits of quartz, corundum or beryl.