Wavelength to RGB in Python

From Noah.org
Jump to navigationJump to search


Wavelength to RGB in Python

This class converts a given wavelength in nanometers to a 24-bit R,G,B value. This is obviously a very approximate conversion and will not appear the same on every display device.

The input wavelength range is 380 nm through 750 nm (red through violet).

For testing see PNG_canvas_in_Python.

spectrum -- 380 nm through 750 nm