Coloured lighting in traditional lighting, Par Cans, Fresnels etc., was created by putting a Gel coat (a piece of coloured transparent film) in front of the light fixture. This is still used today in a lot of theatres.
More advanced traditional lighting use what is called a colour scroller. This is a device that is placed in front of the Par Can or other lighting fixture and contained a cartridge of colour gels in one long line. The light operator could then choose what colour they wanted to show and the scroller would wind to the correct place and the new colour would be shown. This would normally be done when the lamp was not lit as the scrolling would not be that fast and you would get multiple colours being displayed until it got to the correct place.
Most modern, intelligent lighting fixtures use dichroic filters to produce the colour required and these are placed on a colour wheel which can be rotated in front of the light beam. Depending on the manufacturer and the lighting fixture will determine the number of of colours available. Some have two colour wheels that over lap so you will get a form of colour mixing.
There are also CMY colour wheels, this normally is done by three wheels of colour Cyan, Magenta and Yellow, that overlap each other and depending on their position will generate a different colour. This enables you to produce nearly any colour you like. Normally only available on high priced/specified fixtures.