def norm_rgb(r, g, b):
 greatest = max([r, g, b])
 if (greatest > 0):
  r /= greatest
  g /= greatest
  b /= greatest
 return (r, g, b)

def norm_rgb ( r , g , b ) : greatest = max ( [ r , g , b ] ) if ( greatest > 0 ) : r /= greatest g /= greatest b /= greatest return ( r , g , b )
normalise rgb components so the most intense has a value of 1 .