Skip to content

Instantly share code, notes, and snippets.

View tvercaut's full-sized avatar

Tom Vercauteren tvercaut

View GitHub Profile
@tvercaut
tvercaut / wavelength_to_rgb.py
Last active March 21, 2024 17:28
Simple python function to get an approximate RGB value for a given wavelength
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
def wavelength_to_rgb(wavelengths, gamma=0.8):
'''This converts a given wavelength of light to an
approximate RGB color value. The wavelength must be given
in nanometers in the range from 380 nm through 750 nm
(789 THz through 400 THz).
@tvercaut
tvercaut / !Mux with UDU SEI.md
Last active April 4, 2025 14:52
!Mux with UDU SEI