CCD's are also used in personal digital cameras and video cameras. These semiconductor devices have millions of picture elements, pixels arranged in a square. When a photon hits a pixel the semiconductor absorbs the photon and uses the energy to release an electron. The freed electrons are stored in the pixel until a signal arrives to read-out that pixel. Then all the electrons in the pixel are counted as they are released.
Brighter stars deliver more photons to the pixels of the CCD's than dimmer stars.
Of course this does not tell you the actual brightness of the star, its absolute magnitude or its luminosity unless you also know the distance to the star. Because distant objects appear dimmer due to the inverse square law. Temperature Red hot, white hot, our language expresses temperature in terms of color. Turn on an electric heating element on a stove n a dark room. Yet you detect nothing with your eyes.