Darkness is needed for humans and other species to produce melatonin. The signal about the amount of light in the field of vision is received by the brain through the light-sensitive ganglion cells of the retina (abbreviation ipRGCs from Intrinsically photosensitive retinal ganglion cells). In addition to the familiar rods and cones, this is another photoreceptor on the retina. They were only confirmed in humans in 2007 (Prof. Foster). They were very close to be discovered in blind mice in the 1920s, but the discovery was left behind.
The light-sensitive ganglion cells of the retina are most sensitive to blue light (approximately 450-480 nm). Warm incandescent light has very small proportion of this component. On the other hand, cool white light from fluorescent lamps or light-emitting diodes has a proportion of active component approximately three times that of incandescent light, similar to daylight.
The light from blue LEDs is the most effective in this respect. I can confirm from personal experience that a single intense blue light on a DVD player in the bedroom can cause insomnia.