Tarantulas don't just come in brown and black. These large, hairy spiders can also display wonderful hues of blue, green, purple, and red.

Yet tarantulas are most active at twilight, meaning they're 'crepuscular' animals – where vibrant colours are significantly harder to see (at least for us). Until now, researchers didn't know if they could even see their own fabulous colour patterns in the dimness of dusk.

Now, however, a new study suggests that tarantulas can see colours just as well as their day-exploring brethren, and even suggests the functions for two hues in the tarantula colour wheel – green and blue.

If you think of your own vision in the dark, colours appear to be much less distinctive, and our eyes can struggle to tell one hue from another.

But some animals, such as geckoes, moths, and bats, have strong colour vision even in near total darkness.

In the new study, the team analysed photos of 37 genera of tarantula from around the world, and measured the spectrum of colours, noted specific behavioural traits, as well as analysing their evolutionary history.

Although we don't yet know just how well these creatures see these colours in the dark of night, the researchers found that tarantulas have lots of types of opsin genes – which produce opsin proteins, found in photoreceptor cells, and which help animals see colour.

"Despite their crepuscular tendencies, tarantulas express a considerable diversity of opsin genes – a finding that contradicts current consensus that tarantulas have poor colour vision on the basis of low opsin diversity," the team explains in a new paper.

They found that most tarantulas have nearly an entire complement of opsins found in spiders active during the day, like the colourful dancing peacock spiders – suggesting tarantulas do indeed see colours.

The researchers also investigated whether certain spidery behaviour could be related to the distinct blue and green colours the tarantulas wear. Specifically, they investigated stridulation (rubbing their mouthparts together to make a noise to ward off predators), urticating bristles (the hairs which tarantulas can shoot off themselves as a weapon), and being arboreal (living in trees).

Although that might seem like a bit of a leap, stridulation and urtication were investigated because if blue or green are colours that tell predators to 'stay away', it was hypothesised that the spiders would also be able to defend themselves better than those without those colours.

They couldn't find any connection between stridulation and urticating bristles and either blue or green colouring, but they did find that green probably helps the spiders avoid being seen - called crypsis.

"The evolution of green coloration appears to depend upon the presence of arboreality, suggesting that it probably originated for and functions in crypsis through substrate matching among leaves," the team writes.

But that idea doesn't work so well with the dazzling metallic-blue tarantulas.

Although the researchers weren't able to find any connection between stridulation, bristles, or arborealism, they do still have a hypothesis.

"While the precise function of blueness remains unclear," explains Carnegie Mellon University biologist Saoirse Foley, "our results suggest that tarantulas may be able to see these blue displays, so mate choice is a likely potential explanation."

The idea that tarantulas can see colour is not just exciting for this team of researchers either.

The team showed that evolutionarily blueness has been lost more often than it has been gained in tarantula species, while the green colour has evolved only a few times, but once there it sticks around.

"I'm thrilled," University of Cincinnati evolutionary biologist Nathan Morehouse, who was not involved in the research, told The New York Times.

"This makes tarantulas a very exciting group moving forward to think about."

The research has been published in Proceedings of the Royal Society B.