A lightning bolt is often labeled white, yet its spectrum is a moving target shaped by the air it rips through and the way eyes collect the flash. The discharge forms a hot plasma that forces electrons in nitrogen, oxygen and trace gases into excited quantum states, then lets them fall back, releasing photons at sharply defined wavelengths.
Those emission lines act like a barcode. Dense, humid air with more water vapor and aerosols scatters shorter wavelengths and lets longer ones dominate, nudging the glow toward red. Colder, cleaner air with higher oxygen and less particulate matter favors bluish and violet features. Ionization fraction, electron temperature and local pressure together set which transitions in molecular nitrogen and atomic oxygen dominate, shifting the apparent mix toward purple fringes or green cores, especially when oxygen lines in the green band strengthen.
Geometry finishes the job. A distant bolt filtered through thick, dusty atmosphere loses much of its blue through Rayleigh scattering and extinction, so observers see a warmer red or orange tone. A near overhead channel viewed against dark cloud reveals more of the intrinsic high-energy spectrum and looks harshly blue-white or violet. Human color perception and the spectral response of camera sensors add another layer of selection, turning a nominally broad, white-weighted emission into flashes that cameras and retinas register as red, purple or green accents.