def brush_darker(brush, factor):
 grad = brush.gradient()
 if grad:
  return QBrush(gradient_darker(grad, factor))
 else:
  brush = QBrush(brush)
  brush.setColor(brush.color().darker(factor))
  return brush

def brush_darker ( brush , factor ) : grad = brush . gradient ( ) if grad : return QBrush ( gradient_darker ( grad , factor ) ) else : brush = QBrush ( brush ) brush . setColor ( brush . color ( ) . darker ( factor ) ) return brush
return a copy of the brush darkened by factor .