Not everything in space are clouds of hydrogen, as I say in these comments that I do not give a damn. Gas clouds swarming through space because supernovas that have exploded (and therefore are not only the outer layers of a star) also comprise other elements.
For example, in this image of NGC 7822 with multiple filters, you can see red oxygen and hydrogen sulfide with blue.
In a star within it, because gravity is the center, the hydrogen is converted into helium by nuclear fusion but heavier elements are also created when helium (or hydrogen itself) merges “mas” each . Hydrogen is the base but oxygen, ferrous material, sulfur and other elements are created equally in the stars.
And remember that when they become neutron stars, the core of these (which is pretty much all serious and have been on the verge of being a black hole) can hold up heavier elements. Its radiation (remember that light is also radiation) is due to the photodisintegration of the star elements usually it contains iron.