We’ve seen them glowing on New York City theater billboards, Las Vegas casinos and Hong Kong high-rises. They cast unbidden light and shadow into restaurants and homes and are a part of the daily scenery for millions. But neon signs, once a vital part of a city’s culture and barometer for its economic climate, are fading out of sight as the once-popular technology disappears from the streets.

An online exhibition tells the story of neon’s history, which began purely by accident.

When the British chemist William Ramsay was first trying to identify the element neon, a noble gas he discovered in 1898, he enclosed it in a container and applied electricity. A “blaze of crimson” came from the container — the first sparks of a new industry.

Now, neon has become a symbol of capitalism, business and the economic climate that surrounds it. But lower-cost alternatives are replacing it, especially in Hong Kong, where thousands of signs are being taken down. Hong Kong’s M+ Museum has begun building a permanent collection of these signs and created an online exhibition where users can check out a map of signs around Hong Kong along with essays on the signs’ cultural significance.

First, a primer on how they work: to make the signs, craftspeople bend tubes of heated glass into a desired shape. The glass is filled with a combination of gases that respond to electricity by emitting light; “neon” has become industry shorthand for the effect that these gases produce. Electrical leads are embedded to each end, and when a voltage is applied, it excites electrons in the gases’ atoms — causing a glow.

French engineer Georges Claude created the first neon lamp in 1902, and in 1910 displayed his invention publicly for the first time at the Paris Motor Show. In 1912, Claude created what many believe to be the first neon advertisement: the words “PALAIS COIFFEUR,” which lit up 14 boulevard Montmartre in Paris. By 1914, more than 100 businesses in Paris followed suit, attracting attention to their storefronts with neon. Claude was awarded a U.S. patent for the neon light in 1915 and began selling licenses to others who wanted to produce them.

Neon did not come to the U.S. until 1923, when the Roaring 20s were underway and the automotive industry was booming. Claude sold a pair of neon signs to a Packard car dealership in Los Angeles, which stopped traffic among onlookers who reportedly called the light “liquid fire.” The U.S. auto industry had new visual shorthand for the consumerism that drove it.

“I think people really respond to neon,” said Kevin Adams, a theatrical lighting designer who used neon-imitating LEDs in a design for the Metropolitan Opera’s production of “Rigoletto” in 2013. “There’s a kind of cool factor related to it that people respond to.”

Wherever the signs are used, they are a visual hallmark of consumerist city culture, said Lawrence Pun, a cultural critic living in Hong Kong. “The visual stimulus of the neon sign seems to reflect the prosperity that fuels urbanites’ desires,” Pun wrote in an essay for the M+ Museum exhibit. “Capitalist society is predicated on city dwellers’ desire to consume.”

This prosperity was apparent in a 1929 description of New York City’s neon lights from the newspaper “Brooklyn Life and Activities of Long Island Society,” published roughly three months before the stock market crashed:

From the corner of Broadway and Forty-second Street, where the bright-light district begins, the view at night is a vast panorama of color red squares and rectangles enclosing green letterings and blue-purplish lines providing a setting for yellow flashes and orange bolts of electric lighting. Looking to the east, deep red is easily the favorite. Crimson lights proclaim the wares of radio stores, restaurants, drug stores and a merchandiser of sporting goods.

In the 1930s, even as the Great Depression plunged the U.S. economy into crisis, neon swept through the country, with Times Square becoming its neon epicenter. Meanwhile, Hong Kong’s first neon shop opened in 1932, and neon signs gained popularity in Hong Kong during the 1930s and in the postwar era.

As a medium that first gained a foothold in advertising, the rise of neon, and eventually its decline, are strongly associated with consumer wealth and economic class. Its early use for automotive advertising links it to the industry that President Barack Obama recently credited with having “built the middle class in this country.” At the time they first appeared in the 1920s, neon signs were a sign of strong business.

But neon gradually became associated with lower classes. While businesses began to replace neon signs in the 1950s and 1960s, many of the businesses that retained them were working-class establishments — mostly “cheap, rather run-down bars, hotels and restaurants that could not afford brand-new advertising displays,” according to the book “Flickering Light: A History of Neon.”

In Hong Kong, neon signs now mostly appear outside independent businesses as global corporations phase them out, according to Christoph Ribbat, a Professor of American Studies at the University of Paderborn, Germany. But as even those are taken down and replaced by LEDs, fluorescent tubes and other alternatives, locals ask what is being lost.

One of Hong Kong’s iconic signs, the neon cow that appeared outside of Sammy’s Kitchen for over 35 years, was taken down this month after the Hong Kong Buildings Department ruled it illegal. The M+ Museum will acquire that sign.

Sammy Yip, who owns Sammy’s Kitchen, told the South China Morning Post he was glad it would find a new home in the museum. “At least I can go there and have a look at it from time to time,” he said. “I have deep emotional attachment to this neon cow.”

Lower-cost alternatives can mimic neon, but its brightness and vivid colors are hard to fully reproduce, according to Adams. “There’s just nothing else like it,” he said. “The colors that neon can make, you can’t reproduce with other products — the deep purples and ambers and yellows.”

Today, the storefront that first displayed a neon sign in Paris has become a Hard Rock Café, the American theme restaurant whose brand rests on nostalgic rock-and-roll memorabilia and neon.

Many cities still have neon artists producing signs, Adams said. But he questioned how many people will know the difference as they eventually fall out of use.

“Do they even notice when it’s not neon?” he said.