Maybe it was the orange T-shirts.

After watching Montgomery County’s library budget be cut by more than a quarter in just a few years, supporters of the libraries decided they would for the first time wade into the arena of color-coded lobbying.

Union members had donned yellow T-shirts. The Arts and Humanities Council has chosen green, red and other hues over the years, stylishly featured on coordinated ties, scarves, buttons and blazers.

So when library boosters took their case against another big cut to the County Council, they showed up at the hearings in bright colored shirts stamped with a simple message that would have done Hemingway proud: “Libraries matter. No more cuts.”

“We had always assumed that people recognized the intrinsic value of libraries to Montgomery County, and we came to the stark realization that more persuasion was needed,” said Art Brodsky, chairman of the county’s appointed library board.

Montgomery’s months-long struggle to close a $300 million budget gap was animated by a raucous fight over employee benefits. County Executive Isiah Leggett (D) proposed health and retirement cuts in March, and the council approved its own version Thursday when it passed a $4.37 billion operating budget for fiscal 2012.

The benefits effort saved $33 million, but it was part of what officials said was a broader bid to reset spending — and to recalibrate expectations about what the county can and cannot do for the people who live and work in the state’s most populous jurisdiction.

“As the old saying goes, ‘You can’t know where you’re going until you know where you’ve been,’ ” council President Valerie Ervin (D-Silver Spring) said after the budget bearing her imprint passed unanimously.

Six months ago, analysts from the council’s legislative think tank gave elected leaders a detailed analysis of what they called the county’s “structural budget deficit.” What they meant was that, beyond sagging revenue from a slumping economy, the county had dug itself a long-term money problem: Years of generous spending on services and employees has left Montgomery facing large budget shortfalls for years to come.

The way out, the analysts said, was not one-year fixes such as employee furloughs but finding savings that will reduce recurring costs far into the future. And because the bulk of government spending comes down to the people providing services, the choices were stark: The county could cut the number of things government does, the number of people doing them or the amount of compensation those people receive — or they could tap taxpayers for much more money.

Officials calculate, for instance, that $33 million in cuts to health and retirement spending next year would end up saving more than $273 million over six years, without the county executive or council having to identify new cuts.

The council took a host of other major steps, some hotly contested, some unglamorous yet important, such as agreeing with a Leggett proposal to set aside $62 million as a payment toward the county’s $3.5 billion retiree health-care obligation.

The council’s decision to push not only for more savings from the school system but also to take more control by insisting cuts come from employee benefits could have lasting implications.

Ervin, a former Board of Education member, and other council members argued that the only way for the county to make real headway in achieving long-term savings, this year and into the future, was to include the school system, which has more than two-thirds of the county’s employees. The added attention, and the millions in resulting cuts, have provoked an angry response.

“An important factor in your home’s value is the quality of your neighborhood public schools,” said an e-mail blast from the teachers union. “Deep cuts to public education could put our schools and your property value at risk.”

School officials said they are expecting 3,400 new students next year. But their overall budget is shrinking by just less than 1 percent, to $2.09 billion.

“We still have to add teachers and other staff to support new students,” said Marshall C. Spatz, the schools budget director.

But county officials said they needed to find a way to moderate what would have been severe cuts to other government departments, including libraries.

“If you don’t have libraries, that has a direct affect on schoolchildren. If parents can’t get health care, that has a direct affect on schoolchildren,” council member George L. Leventhal (D-At Large) said.

Library funds for new books had fallen so short that astronomy texts were still calling Pluto a planet, he said, and waits for books were getting impossibly long. “If you put a hold on a book, and are told you have to wait a year, that’s unacceptable to Montgomery County taxpayers,” Leventhal said.

The county is facing a large budget shortfall again in its fiscal 2013 budget — a major energy tax is scheduled to expire, for example. In addition, county officials hope to add $90-plus million more for future retiree health care than they did this year.

To the great joy of library advocates, the council and Leggett found a way to restore $2.3 million of the proposed $2.8 million in library cuts Thursday. Although libraries will still have to make modest cuts, they won’t have to eliminate staff in Silver Spring, Long Branch, Twinbrook and Chevy Chase. In addition, they got back $1 million for new books, DVDs and maybe some databases.

“When everybody in an orange shirt stood up and recited the slogan with me, it got the attention of the council,” Brodsky said. “It’s like for the past three years, and a good chunk of this year, the tide was going in one direction, and we stopped it.”