Generating in-focus color images by scanning the focal length and acquiring multiple color images with different focal planes. The in- focus image generated from these multiple images is suitable to be combined with a scanning confocal three dimensional measurement performed by the same system. Teh system can be used for intra-oral scanning.