The road cut in the picture below is a famous geological stop on the east side of the Jemez Mountains between San Ildefonso Pueblo and Los Alamos. Below is a sheet of very dark lava. This lava is buried in many feet of light-colored, nearly white pumice, a kind of volcanic ash. There is a striking contrast of color as well as texture here.
Silicate minerals rich in the metallic elements iron and magnesium are typically dark in color. Geologists, with their knack for making up hybridized words - preferably from obscure languages - use a term compounded out of magnesia and ferrum to describe these dark minerals: mafic. Apparently everyone got tired of writing "ferromagnesian" in their papers.
This term soon applied to the dark-colored volcanic rocks as well.
Silicate minerals lacking iron and magnesium are light in color. These minerals coincidentally contain a higher proportion of silica - silicon and oxygen combined - than the mafic minerals. Volcanic rocks composed of these minerals are called silicic.
So the color of volcanic rocks is a reflection of their mineral content. In the road cut you can see, in literal black and white, the contrast between mafic and silicic volcanic rocks.