Opacity is a quantity that measures a material's ability to absorb or scatter electromagnetic radiation; the opposite of transparency. Opacity depends on the composition, density, and temperature of the medium, and on the wavelength of the radiation. Since opacity at a given temperature depends on the number of particles per unit volume, and since heavier elements contain more electrons than lighter elements, the opacity of a star increases with increasing proportions of heavy elements. In fact, in stellar interiors, the carbon group and the metals primarily determine the opacity.