def darken(color, factor=0.7):
 newcol = color_to_reportlab(color)
 for a in ['red', 'green', 'blue']:
  setattr(newcol, a, (factor * getattr(newcol, a)))
 return newcol

def darken ( color , factor = 0.7 ) : newcol = color_to_reportlab ( color ) for a in [ 'red' , 'green' , 'blue' ] : setattr ( newcol , a , ( factor * getattr ( newcol , a ) ) ) return newcol
darken a color by decreasing its lightness by percent .