A lighting device and method with a lighting unit which includes several light sources having different color spectra, with a sensor for determining the spectral power distribution emitted by the lighting unit, with a control unit which, as a function of a predetermined spectral power distribution as well as of the spectral power distribution measured by the sensor, acts on a drive unit which individually energizes the light sources of the lighting unit, so that the emitted light has predetermined spectral power distribution, wherein the lighting unit includes at least four light sources, and the control unit uses an optimization algorithm which, as an optimization goal, maximizes a coefficient of weighted sensor values, the coefficient being calculable from individual drive data of the light sources. A secondary condition is met when error between the predetermined spectral power distribution and the measured spectral power distribution is smaller than a limit value.