def wlPen(wl):
 l1 = 400
 l2 = 700
 hue = np.clip(((((l2 - l1) - (wl - l1)) * 0.8) / (l2 - l1)), 0, 0.8)
 val = 1.0
 if (wl > 700):
  val = (1.0 * (((700 - wl) / 700.0) + 1))
 elif (wl < 400):
  val = ((wl * 1.0) / 400.0)
 color = pg.hsvColor(hue, 1.0, val)
 pen = pg.mkPen(color)
 return pen

def wlPen ( wl ) : l1 = 400 l2 = 700 hue = np . clip ( ( ( ( ( l2 - l1 ) - ( wl - l1 ) ) * 0.8 ) / ( l2 - l1 ) ) , 0 , 0.8 ) val = 1.0 if ( wl > 700 ) : val = ( 1.0 * ( ( ( 700 - wl ) / 700.0 ) + 1 ) ) elif ( wl < 400 ) : val = ( ( wl * 1.0 ) / 400.0 ) color = pg . hsvColor ( hue , 1.0 , val ) pen = pg . mkPen ( color ) return pen
return a pen representing the given wavelength .