You are currently viewing the gmlscripts.pro static mirror. Forum access and script submissions are not available through this mirror.

Invert gmlscripts.pro

wavelength_to_hue

wavelength_to_hue(nano)
Returns the approximate HSV color hue [0..255] of a given wavelength.
COPY/// wavelength_to_hue(nano)
//
//  Returns the approximate HSV color hue [0..255] of a given wavelength.
//  Human color perception is a subjective phenomenon. It is not possible
//  to exactly map an RGB color on a monitor to a specific wavelength.
//  In particular, colors in the purple range will produce spurious results.
//
//      nano        wavelength in nanometers, real
//
/// gmlscripts.pro/license
{
    return (sqrt((argument0 - 650) / 0.0072) + 156.75);
}

Contributors: Leif902

GitHub: View · Commits · Blame · Raw