The guppy is known to exhibit remarkable interindividual variations in spectral sensitivity of middle to long wavelength-sensitive (M/LWS) cone photoreceptor cells. The guppy has four M/LWS-type opsin genes (LWS-1, LWS-2, LWS-3 and LWS-4) that are considered to be responsible for this sensory variation. However, the allelic variation of the opsin genes, particularly in terms of their absorption spectrum, has not been explored in wild populations. Thus, we examined nucleotide variations in the four M/LWS opsin genes as well as blue-sensitive SWS2-B and ultraviolet-sensitive SWS1 opsin genes for comparison and seven non-opsin nuclear loci as reference genes in 10 guppy populations from various light environments in Trinidad and Tobago. For the first time, we discovered a potential spectral variation (180 Ser/Ala) in LWS-1 that differed at an amino acid site known to affect the absorption spectra of opsins. Based on a coalescent simulation of the nucleotide variation of the reference genes, we showed that the interpopulation genetic differentiation of two opsin genes was significantly larger than the neutral expectation. Furthermore, this genetic differentiation was significantly related to differences in dissolved oxygen (DO) level, and it was not explained by the spatial distance between populations. The DO levels are correlated with eutrophication that possibly affects the color of aquatic environments. These results suggest that the population diversity of opsin genes is significantly driven by natural selection and that the guppy could adapt to various light environments through color vision changes.