The absolute brightness or luminosity is one means of distinguishing between stars. However, two stars of the same absolute brightness are not necessarily identical in every other aspect. One other feature of stars which is useful in their classification is their color or spectral type. Every gas has a distinctive fingerprint depending on its temperature.
Hot stars are typically blue in color while cool stars are red.
A classic example of this is that of sodium street lamps. A lamp filled with sodium gas has a distinctive yellow color while an argon lamp, for example, is typically red. By identifying the characteristic colors emitted by a star, it is possible to determine which elements make up the gas and what the temperature of the gas is. The spectrum of a star rather than its luminosity is what is used to classify it. Because of the relationship between spectral type and how hot the stellar surface is, we can characterize a star by its temperature.