Function
A pilot needs color vision in order to recognize key signals in everyday aviation safety: airport beacons, aircraft position lights, approach-slope indicators, light guns and chart markings. These signs and symbols are especially important at night, when colorblind individuals are even more challenged to see them.
FAA Regulations
The FAA's 14 CFR Part 67 regulations state that any pilot must possess "the ability to perceive those colors necessary for the safe performance of airman duties" and that these faculties must be medically certified by an aviation medical examiner, or AME.
Negative Results
The FAA requires the medical examiner to prohibit anyone that fails such a color vision test from night flying. Surprisingly, many would-be pilots discover functional colorblindness during this testing process.
Self-Testing
If you're concerned you may be colorblind and desire to confirm your suspicion before setting an appointment with an AME, try taking a cure color-vision test online. If the test suggests that you may indeed have a color-vision disability, work with an optometrist or ophthalmologist to evaluate you with an FAA-approved alternative test.
Corrective Lenses
No eyeglasses or contact lenses are able to correct a deficiency in color vision seamlessly. A special contact lens, the X-Chrom, can partially correct the color deficiency, but it impairs other aspects of vision, so the FAA forbids pilots to use them.