Ronald Reagan took a colorful tour of Tex-Mex country today on a schedule designed to maximize "visuals" for the television crews and de-emphasize the candidates's audible contribution to the nightly news. But Reagan still found himself on the defensive most of the day, answering President Carter's charge that he had opposed a landmark civil rights law.

Reagan and his campaign aides were clearly disturbed this morning when the traveling press corps asked him to respond to the president's assertion. The candidate moved adroitly later to focus criticism back on Carter, but nonetheless the result was another campaign day largely taken up with explanations.

It was not supposed to be that way. As Reagan's schedulers planned it, he was to spend Mexican independence Day, a major event in South Texas, on a telegenic tour of border towns and then wing off to Houston.

Reagan was being joined in Houston tonight by his running mate George Bush, former president Gerald Ford, and a galaxy of Republican stars at a gala dinner that has broken all records for single-event political fund-raising. sold $2.8 million worth of tickets. Ordinarily a dinner drawing one-tenth as much is considered fairly big in fund-raising circles.

For the candidate's Texas swing, Reagan people had prepared a series of short, routine speeches that could not complete for TV time with the parades, river boat rides and mariachi musicales that dotted the day's schedule. "This is sort of a color day," a campaign planner explained.

But his morning, just after Reagan and his wife had debarked from a flower-and-flag bedecked launch on the San Antonio River, he was surrounded by reporters asking about Carter's statement, in a campaign speech in Atlanta, that Reagan had opposed the 1964 Civil Rights Act.

Reagan's expressive face crinkled into a pained frown and he responded, in defensive tones: "Back then there were a great many people who questioned some things [in the law] . . . but it has worked . . . and I'm satisfied with it."

He winced again a few minutes later when the network reporters made him repeat the explanation for their cameras.

This afternoon, after Reagan aides had obtained the text of Carter's harsh criticism -- the president said he saw "stirrings of hate" in the campaign -- Reagan arranged another "impromptu" news conference, and this time went on the offensive.

Carter's attack, Reagan said, was "shameful, because whether we're on the opposite sides or not, we ought to be trying to pull the country together." t

Except for this, Reagan today stuck closely to his prepared script as he followed a campaign route Carter had traveled Monday in a state both candidates list as "must win."

Other than a brief lapse in Harlingen, where he referred to Miguel Hidalgo, a rural Mexican pastor who triggered the revolt against Spain 170 years ago today, as a "brave American priest," the former actor performed perfectly.

He said that Carter had bungled Mexican-American relations and had failed to deal adequately with the flood of illegal ailens. He said these "undocumented workers" -- the preferred term among Hispanic groups -- should be given visas and allowed to work in this country "for whatever length of time they want to stay."

Reagan's speeches during the day in heavily Democratic South Texas counties and his speech at the big Houston fund-raiser tonight suggested that the rural Hispanics along the border and the wealthy Republicans in Houston have basically identical values.

"Hispanics have a deep and abiding belief in the value of work," he said. "There is a great attachment to the great human right of property ownership . . . we both have always believed that in this land of freedom men and women could create wealth and prosperity."

During his sweltering border tour, Reagan traded his coat and tie for a pale blue guayabara, the loose smock Latin Americans wear to beat the heat. He mugged for the cameras in a big sombrero, danced with a children's mariachi band and posed proudly with a hand-tooled western saddle, complete with stirrups and lariat; that an admirer gave him in Harlingen.

He ran into a few Carter posters and a number of Equal Rights Amendment demonstrators. The women, shouting in the unmistakable accent of South Texas, turned the familiar feminist chant into "Equal pay, equal rats."