igneous rocks are formed by solidification of cooled magma (molten rock), with or without crystallization, either below the surface as intrusive (plutonic) rocks or on the surface as extrusive (volcanic) rocks.
the composition depends on the source magma. there are almost a thousand types of composition found till now.
hope this