/lambda2color

A simple library to transform a given light wavelength into the corresponding RGB color.

Primary LanguagePythonMIT LicenseMIT

license Binder PyPI version

lambda2color: convert a given light wavelength into the corresponding RGB color

This is a simple library to transform a given light wavelength into the corresponding RGB color.

It is based on the different sensitivities to a novel color space called the CIE 193 " XYZ" color space and defined by the CIE colour matching function for 380 - 780 nm in 5 nm intervals :

CIE colour matching function

This allows to simply compute for instance the color of different monochromatic lights:

Rainbow

For more advanced uses, see for instance this blog post computing the color of the sky.