The gemstone opal is beloved for its scintillating array of colours.

Now the nanostructures that make those dazzling colours possible have been found elsewhere - in a common type of seaweed found throughout European coastal regions.

Brown algae (Cystoseira tamariscifolia) is also called "rainbow wrack." When out of the water and dry, it's a dark, nondescript dark olive colour.

Closely related species Cystoseira ericoides. (Dr Mary Gillham Archive Project/Flickr)

But when thriving under the water, it shimmers with blue and green iridescence.

This iridescence, researchers from Bristol's School of Physics and Department of Electrical Engineering have shown, are the result of a structure of nanoscale spheres - organised to control how the light reflects from the chloroplast-containing seaweed cells.

(Lopez-Garcia et al./Science Advances)

Although not yet demonstrated, this structure has the potential to modify light levels within photosynthetic cells - as it controls and optimises the seaweed's ability to photosynthesise.

This type of structure is only seen in one other place in nature - opals, the mineraloid silica gemstone created underground by water deposition.

In opals, highly organised nanoparticles are made of silica, and they're responsible for the shifting play of colour that seems to come from inside the stone.

In brown algae, these nanoparticles are made not from silica, but tiny beads of oil produced by the seaweed.

Even more astonishing - the seaweed can reassemble the structures in response to changing light. In a matter of hours, the seaweed can turn its iridescence on or off entirely, depending on light conditions.

The researchers discovered that, in full light, the seaweed loses its iridescence, turning dark. But in low light conditions, it begins to shimmer again.

The team imaged the seaweed at a sub-nanoscale level during these changes, and found that when it shimmers, the nanospheres are arranged in a lattice; but when it's not shimmering, the nanospheres are disorganised.

This new finding contradicts previous research into the seaweed's structure, which concluded that the spheres were randomly scattered.

"The formation of opals from oil droplets is a completely new discovery," said lead author Martin Lopez-Garcia, now an optical engineer at the International Iberian Nanotechnology Institute in Portugal.

"If nanotechnologists were able to understand and mimic the dynamic properties of this seaweed opal, we may in the future have biodegradable, switchable display technology that may be used in packaging or very efficient, low cost solar cells."

The research has been published in Science Advances.