Spectroscopy has been called fingure printing the stars, it helps astronomers to determine the composition, temperature, density, and motion of an object. Infrared spectroscopy helps to identify the atoms and molecules in the object. The red shift or blue shift (Doppler Effect) in a spectral line tells how fast the object is receding from Earth or coming toward it.
There are two ways I image the spectra of stars; The first is by using a star analyser, which is basically a filter you can screw onto the front of a camera, the second spectroscope I use is an alpy. For more information look at  https://www.shelyak.com/category/projects/?lang=en
If you click on each class you will find the stars I have imaged. (under construction)

star analyser                                                                                                                                                                  alpy
Star TypesStar Colour and heat.
O class Stars: is a main-sequence (core hydrogen-burning) star of spectral type O and luminosity class V. They are between 40,000 and 1,000,000 times as luminous as the Sun.These stars have between 15 and 90 times the mass of the Sun and surface temperatures between 30,000 and 50,000 K and are
B class stars:is a main-sequence (hydrogen-burning) star of spectral type Band luminosity class V. Their spectra have neutral helium, which are most prominent at the B2 subclass, and moderate hydrogen lines. Examples include Regulus and Algol A.These stars have from 2 to 16 times the mass of the Sun and surface temperatures between 10,000 and 30,000 K. B-type stars are extremely luminous and blue.
A class stars: is a main-sequence (hydrogen-burning) star of spectral type A and luminosity class V. These stars have spectrawhich are defined by strong hydrogen Balmer absorption lines.  Bright and nearby examples are Altair (A7 V), Sirius A (A1 V), and Vega (A0 V).They have masses from 1.4 to 2.1 times the mass of the Sun and surface temperatures between 7600 and 11 500  K.
F class stars: is a main-sequence, hydrogen-fusing star of spectral type F and luminosity class V.  Because a main-sequence star is referred to as a dwarf star, this class of star may also be termed a yellow-white dwarf. These stars have from 1.0 to 1.4 times the mass of the Sun and surface temperatures between 6,000 and 7,600 K. This temperature range gives the F-type stars a yellow-white hue.
G class stars: often (and imprecisely) called a yellow dwarf, or G dwarf star, is a main-sequence star (luminosity class V) of spectral type G.  Like other main-sequence stars, a G-type main-sequence star is converting the element hydrogen to helium in its core by means of nuclear fusionSuch a star has about 0.84 to 1.15 solar masses and surface temperature of between 5,300 and 6,000 K.
K class stars:  Often referred to as an orange dwarf or K dwarf, is a main-sequence (hydrogen-burning) star of spectral type K . These stars are intermediate in size between red M-type main-sequence stars ("red dwarfs") and yellow G-type main-sequence stars. Better known examples include Alpha Centauri B (K1 V) and Epsilon Indi. They have masses between 0.45 and 0.8 times the mass of the Sun and surface temperatures between 3,900 and 5,200 K.
M class stars: Class M stars are by far the most common. About 76% of the main-sequence stars in the solar neighborhood are class M stars. However, class M main-sequence stars (red dwarfs) have such low luminosities that none are bright enough to be seen with the unaided eye, unless under exceptional conditions. The brightest known M-class main-sequence star is M0V Lacaille 8760, with magnitude 6.6 (the limiting magnitude for typical naked-eye visibility under good conditions is typically quoted as 6.5), and it is extremely unlikely that any brighter examples will be found. These  are old stars about 100 times larger than originally was, and has become cooler around 6,500K and red/orange colour.
W class stars:Class W or WR represents the Wolf–Rayet stars, notable for spectra lacking hydrogen lines. Instead their spectra are dominated by broad emission lines of highly ionized helium, nitrogen, carbon and sometimes oxygen. They are thought to mostly be dying supergiants with their hydrogen layers blown away by stellar winds, thereby directly exposing their hot helium shells.  Their surface temperatures range from 30,000 K to around 200,000 K, hotter than almost all other stars.