Structural color doesn’t use pigments at all and instead uses very ornate tissue structures at the nanoscale. Basically some animals’ tissues will fold into highly complex structures at the nanometer level—or in other words, at same scale as the wavelength of light. Those structures affect the way light passes through biological tissues, so they can essentially filter out certain wavelengths and produce really strong colors.
…[Smithsonian:] What types of fossils preserve color best? [McNamara:] We think we should be looking for fossils preserved in the mineral calcium phosphate. That was the case with the snake that we studied in 2016. The colors of the snake are preserved; the whole skin of the snake is preserved.
Read full, original post: How Do Scientists Know What Colors Prehistoric Animals Were?