In most animals, the origins of mating preferences are not clear. The "sensory-bias" hypothesis proposes that biases in female sensory or neural systems are important in triggering sexual selection and in determining which male traits will become elaborated into sexual ornaments. Subsequently, other mechanisms can evolve for discriminating between high- and low-quality mates. Female guppies (Poecilia reticulata) generally show a preference for males with larger, more chromatic orange spots. It has been proposed that this preference originated because it enabled females to obtain high-quality mates. We present evidence for an alternative hypothesis, that the origin of the preference is a pleiotropic effect of a sensory bias for the colour orange, which might have arisen in the context of food detection. In field and laboratory experiments, adult guppies of both sexes were more responsive to orange-coloured objects than to objects of other colours, even outside a mating context. Across populations, variation in attraction to orange objects explained 94% of the inter-population variation in female mate preference for orange coloration on males. This is one of the first studies to show both an association between a potential trigger of a mate-choice preference and a sexually selected trait, and also that an innate attraction to a coloured inanimate object explains almost all of the observed variation in female mate choice. These results support the "sensory-bias" hypothesis for the evolution of mating preferences.