It appears that short wavelength light (that is light around the blue and purple end of the electromagnetic spectrum) does have a significant effect on melatonin levels and the 'alerting response'.
Exposure to 2 h of monochromatic light at 460 nm in the late evening induced a significantly greater melatonin suppression than occurred with 550-nm monochromatic ligh - See more at: http://press.endocrine.org/doi/abs/10.1210/jc.2004-0957#sthash.feusLJf4.dpuf
Note that 450nm wavelength light is blue and 550nm light is yellow.
Interestingly, there is some evidence that occular photoreceptors (being neither rods nor cones) play a role in setting the circadian clock. These researchers hypothesize that retinal ganglion cells (nerve cells) are photo-receactive and play a role in regulating the circadian clock via innervation of the hypothalamus in the central nervous system.
Light synchronizes mammalian circadian rhythms with environmental time by modulating retinal input to the circadian pacemaker—the suprachiasmatic nucleus (SCN) of the hypothalamus. Such photic entrainment requires neither rods nor cones, the only known retinal photoreceptors. Here, we show that retinal ganglion cells innervating the SCN are intrinsically photosensitive. Unlike other ganglion cells, they depolarized in response to light even when all synaptic input from rods and cones was blocked. - Science 8 February 2002:
Vol. 295 no. 5557 pp. 1070-1073
DOI: 10.1126/science.1067262 http://www.sciencemag.org/content/295/5557/1070.short
So, while there is no 'formula' per-se, we might conclude that higher energy wavelengths (that is shorter wavelengths near blue and purple) are more effective in suppressing melatonin and more effecting in keeping you awake, as opposed to lower energy wavelengths like yellow and red.