Has research been done to determine how closely the color receptors in various species match what one might expect given their evolutionary environment?
This is a fascinating question. Essentially the answer is “yes.” There are a couple of classic vision papers that address the issue. One is H.B. Barlow, “What causes trichromacy? A theoretical analysis using comb-filtered spectra,” Vision Research 22, 635-643 (1982). Barlow shows that the the spectral frequency content in typical color stimuli is adequately sampled with 3 band-limited mechanisms similar to cone responsivities. The second is G. Buchsbaum & A. Gottschalk, “Trichromacy, opponent colours coding and optimum colour information transmission in the retina,” Proceedings of the Royal Society (London), B220:89-113 (1983). They show that opponent channels optimally encode visual information. A more recent reference on the topic is T.-W. Lee, T. Wachtler, and T.J. Sejnowski, “Color opponency is an efficient representation of spectral properties of natural scenes,” Vision Research 42, 2095-2103 (2002).