With bug season approaching, you might be stocking up on citronella, repellent sprays and swatters. But before the murderous assault begins, it’s worth considering the elegant optical wizardry of some of the insects you will be offing.

The shimmering Japanese beetle that flies clumsily, as though its inner pilot is drunk, is one in-your-face example. But look carefully as you’re out there by the barbecue and you might spy iridescent tiger beetles, perhaps paired up — as they often are — in lusty and lustrous embraces. Even many common blowflies, which can maddeningly elude your best anti-bug roundhouses for hours, look a bit like bling just before you make them look like goo.

Annoying yes, but the optical marvels these insects show have not been lost on companies such as 3M, which have found ways to emulate insect iridescence in thin sheets of plastic, and artists such as Sydney-based designer Donna Sgro, who has made dresses using a high-tech material that displays a shimmering blue appearance even though there isn’t a molecule of dye in it.

Why do these jewel bugs look so much more colorful and shimmery — and, for the bug-lover, way cooler — than your average kitchen fly or dime-a-dozen gnat? The answer has to do with the way their fingernail-like exoskeletons transform visible light when they reflect it into our eyes and, also, how we perceive color.

All of the reds, greens and blues in your life correspond to specific wavelengths of light that stimulate the color-sensitive cells, or cones, of your retina, which then send signals to your brain. The wavelengths of these colors range from about 700 billionths of a meter on the redder side of the spectrum to about 300 on the bluer side. Things have specific colors because the materials they are made of, or are coated with, absorb different portions of the visible spectrum and reflect the rest. A leaf is green because its chlorophyll and other pigments absorb all colors except the green that reflects into your eye.

In addition to this absorption and reflection, the colorfest of the world’s most spectacular bugs — and even the ones in your own back yard — is often the result of other types of optical acrobatics, such as refraction and diffraction, which bust up mixtures of wavelengths into their color components.

Consider, for example, the Costa Rican beetles Chrysina aurigans and Chrysina limbata, which look like solid nuggets of gold and silver, respectively. Reporting in the journal Optical Materials Express, a team of chemists, physicists and materials scientists at the University of Costa Rica spell out how the optical bling of these beetles derives from dozens of thin layers of organic material with spacings comparable to the span of a single wavelength of light.

When sunlight enters the stack of layers, something quite eye-catching happens. At each successive layer, some of the light reflects back out, and some penetrates to the next layer. This results in a two-way traffic of light coming and going, with some wavelengths getting dimmed or canceled out by the process but many getting boosted, notes physicist and study leader William E. Vargas. The enhanced reflectiveness of these wavelengths looks to our eyes like shininess, and “this leads to the metallic appearance of the beetles,” he says.

What’s most interesting is that this bling also protects the beetles. “On the foliage of the canopy of the forest where these metallic species of beetles live and get food, they are imperceptible because they reflect the coloration of the foliage,” adds entomologist Angel Solis of the National Institute of Biodiversity in Costa Rica.

The same multi-layer strategy plays out, with many variations, for thousands of insect species. In each case, microscopic physical details of the layers sculpt the reflection patterns, yielding unique color palettes, iridescence and metallic qualities.

Because all of this has to do with the micro-architecture of the bugs’ hard shells and not with pigments, these are known as structural colors. Besides multilayered structures, scientists have observed other light-manipulating structures in insects, including “diffraction gratings,” which are like super-tiny washboards that tease apart white light to create rainbowlike effects, and biological “photonic crystals,” whose regularities can transform light with scintillating, gemlike and opalescent effects.

For years, 3M has marketed a beetle-inspired line of plastic materials that it calls Radiant Light Films. These materials, which do look radiant when light reflects from them, are being used in packaging, light shades, artificial flowers and works of art; the materials have begun finding their way into larger-scale applications such as building windows. As you look at the material from different angles, the colors appear to shift, just the way the colors of a Japanese beetle do.

Donna Sgro, an Australian designer and materials science graduate student, experimented with the synthetic textile Morphotex, whose fibers share the blue iridescence of Morpho butterflies. Sgro used the material to avoid using chemical dyes, which she notes can pose environmental and health hazards. The resulting dresses are not at Filene’s Basement, but one of them is on display at London’s Science Museum.

Undoubtedly, the kind of iridescence employed by Sgro would be more pleasing on your patio this summer than the insect kind. But as you slap and spray away bothersome bugs, stop for a second to notice their bling; that might make them, briefly, more tolerable.

Amato is a writer in Silver Spring and host of the new DC Science Cafe series at Busboys and Poets.