A federal appeals court ruled yesterday that the Food and Drug Administration violated federal law when it approved two dyes for use in cosmetics after deciding that they caused cancer in animals.

Lawyers said the decision, a blow to the cosmetics industry, has implications for five other color additives and a food additive used to remove caffeine from coffee.

A unanimous three-judge panel of the U.S. Court of Appeals for the District of Columbia handed down the decision in a case involving a 1960 law called the Delaney Clause, which prohibits FDA approval of dyes found "to induce cancer in man or animal."

The ruling was hailed as "an important victory" for consumers by William B. Shultz, a lawyer for Public Citizen Inc., the Washington-based nonprofit organization that sued FDA.

The agency had no comment.

Judge Stephen F. Williams's opinion said the court felt that once the FDA had "squeezed the scientific trigger" by recognizing a dye as a carcinogen, Delaney took effect "automatically."

The decision came a week after the House Government Operations Committee concluded the FDA had "no legal authority" to declare that an additive that "induces cancer" somehow fails to "induce cancer" within the meaning of the Delaney clause.

The dyes are Orange No. 17 and Red No. 19. Tests done by the Cosmetic, Toiletry and Fragrance Association showed they caused liver cancer in rodents.

The FDA accepted the tests as valid, and agency scientists urged Commissioner Frank E. Young to disapprove the dyes. Young overruled his scientists, ruling in 1986 that the cancer risk was trivial and implicitly exempt from Delaney.

He relied on a government review panel that assesed the risks, at worst, as 1 in 19 billion for Orange 17, and at 1 in 9 million for Red 19.

The FDA and the Justice Department, in a "clarification" later switched their argument, saying the dyes are safe because their carcinogenic risks are not "within the meaning" of Delaney. The phrase "induce cancer in man or animal" is, they argued "a term of art."

Public Citizen lawyer Katherine A. Meyer said the court's ruling may mean that the FDA will be found to have acted illegally in allowing use of a food additive called methylene chloride, which "a majority" of coffee suppliers use in a caffeine-removal process.

The FDA approved that additive 20 years ago. In 1985 the agency said tests showed it to be an animal carcinogen, but ruled the risk was minimal and approved its continued use.

Public Citizen has challenged that ruling in a suit that is pending before an appeals court panel of which Judge Williams is a member.

In addition, Schultz said the court decision "will require the FDA to remove two additional color additives, Red 8 and 9." A Public Citizen challenge to the approval of these dyes is pending in the 3rd U.S. Circuit Court of Appeals in Philadelphia.

He also said that the ruling is "very likely to result in a ban on three other dyes, including the widely used Red No. 3, which the FDA has conceded to be an animal carcinogen."

The others are Red 33 and 36, which the agency has "provisionally" ruled to be animal carcinogens.