If being able to distinguish colors is a bfoq - Bona Fide Occupational Qualification - then you may ask about it or test it and disqualify people from hiring based on the results.
In fact, a Jury found that color vision is a BFOQ for police but demanded accommodation and in that case the Appeals court denied accommodation is necessary. Other courts found that at times color blindness doesn't count under the ADA at all. Some federal regulations even demand specific ability to have some 3-color vision, as you need to distinguish Red-Green-Amber.
Remember Different color blindnesses see differently, and the following picture illustrates this at a traffic light. Deuteranomaly alters the color picture different than Protanopia, which is different from tritanopia, and then there's the unpictured achromatopsia, which is totally Black-White, among many many other types of color-blindness known to man:
Can someone with any of the three pictured color visions distinguish the traffic light colors but or the position in the traffic light? That is the question that the federal regulation for color vision above demands, making it a requirement for truck driver licenses.
What does that mean?!
For example, a job that relies on distinguishing colors would be sorting or quality control based on the paint of a product. Take for example this sample from the AOA (American Optometry Association) for testing color blindness:
Assume the products come only in the colors of the second row, and only those. If you can't distinguish between the ca. 6 greens, yellow, and about 7 variants of red, then they could not have the qualification, no matter what other qualifications you might have, you could not fulfill the required qualifications for the job of evaluating the color of these items.
On the other hand, a colorblind person can be especially valuable when you deliberately look for color combinations that are still well distinguishable even to people with color distinguishing impairments - and then being normal does not qualify the Bona fide occupational qualification.