Green is a popular color for frogs, and birds too, but that lovely green color doesn’t come from a green pigment as you might expect, but from the interaction of multiple layers of specialized color and light-reflecting cells in the upper layers of their skin.
Frogs have three layers of chromatophores (color-producing cells) in their skin. The deepest layer are melanophores that produce melanin pigment giving skin a brown to black color. The middle layer are iridiphores which contain no pigment but instead have mirror like plates capable of producing iridescence, or when viewed from a certain angle, reflect blue light. The most superficial layer of chromatophores are xanthophores that contain a yellow pigment. When the middle layer of iridophores interact with the top layer of yellow-pigment containing xanthophores, you get what elementary school students have learned: yellow paint + blue paint = green color.
Animals that change their skin color (like some frogs and reptiles) not only can change the shape and size of the chromatophore but the dispersion of the pigment within the cells. Thus, tightly contracted chromatophores with no dispersion of pigment might appear white, and the opposite pattern would look black. Moderate dispersion of melanin pigment in the deepest layer of chromatophores looks gray. Dispersion of pigment in the xanthophores coupled with dispersion of light-reflecting particles in the iridophores produces variation of yellow, blue, and green colors in the skin. Combination of all of the above produces the mottled pattern of coloration the animal uses to blend in with its background — a protective camouflage.
Color change seems to be temperature dependent: warmer frogs are lighter in color to reflect incident light; darker frogs are generally cooler and the darker skin helps them absorb heat. Skin color becomes lighter when these frogs are placed on a brighter background, and darker when placed on a dark background. This color matching is part of the effective camouflage protection. And lastly color change may reflect the mood of the animal — e.g., sexual display, territorial display, etc. The stimulus for all of this change begins in the brain, is transmitted by hormones, and carried out by the actions of the chromatophores — all in a matter of seconds to minutes.
A really detailed and fascinating discussion of how color change is achieved in animals (in this case a Chameleon) is shown below.