Debate on the adaptive origins of primates has long focused on the functional ecology of the primate visual system. For example, it is hypothesized that variable expression of short- (SWS1) and middle-to-long-wavelength sensitive (M/LWS) opsins, which confer color vision, can be used to infer ancestral activity patterns and therefore selective ecological pressures. A problem with this approach is that opsin gene variation is incompletely known in the grandorder Euarchonta, that is, the orders Scandentia (treeshrews), Dermoptera (colugos), and Primates. The ancestral state of primate color vision is therefore uncertain. Here, we report on the genes (OPN1SW and OPN1LW) that encode SWS1 and M/LWS opsins in seven species of treeshrew, including the sole nocturnal scandentian Ptilocercus lowii. In addition, we examined the opsin genes of the Central American woolly opossum (Caluromys derbianus), an enduring ecological analogue in the debate on primate origins. Our results indicate: 1) retention of ultraviolet (UV) visual sensitivity in C. derbianus and a shift from UV to blue spectral sensitivities at the base of Euarchonta; 2) ancient pseudogenization of OPN1SW in the ancestors of P. lowii, but a signature of purifying selection in those of C. derbianus; and, 3) the absence of OPN1LW polymorphism among diurnal treeshrews. These findings suggest functional variation in the color vision of nocturnal mammals and a distinctive visual ecology of early primates, perhaps one that demanded greater spatial resolution under light levels that could support cone-mediated color discrimination.