def wavelength_to_rgb(wavelength: float | int) -> list[float]:
    """
    Converts wavelength in nanometers to the RGB color.

    :param wavelength: wavelength in the nanometers
    :returns: Array of normalized RGB values.
    """
    wavelength = float(wavelength)
    range1 = Range(380, 440)
    range2 = Range(440, 490)
    range3 = Range(490, 510)
    range4 = Range(510, 580)
    range5 = Range(580, 645)
    range6 = Range(645, 780)

    _r, _g, _b = 0.0, 0.0, 0.0
    if wavelength in range1:
        _r = (range1.right - wavelength) / range1.length
        _g = 0.0
        _b = 1.0
    elif wavelength in range2:
        _r = 0.0
        _g = (wavelength - range2.left) / range2.length
        _b = 1.0
    elif wavelength in range3:
        _r = 0.0
        _g = 1.0
        _b = (range3.right - wavelength) / range3.length
    elif wavelength in range4:
        _r = (wavelength - range4.left) / range4.length
        _g = 1.0
        _b = 0.0
    elif wavelength in range5:
        _r = 1.0
        _g = (range5.right - wavelength) / range5.length
        _b = 0.0
    elif wavelength in range6:
        _r = 1.0
        _g = 0.0
        _b = 0.0

    return [_r, _g, _b]

    Converts wavelength in nanometers to the RGB color.

    :param wavelength: wavelength in the nanometers
    :returns: Array of normalized RGB values.
    
art/attacks/evasion/laser_attack/utils.py