def to_qcolor(color):
 qcolor = QtGui.QColor()
 try:
  rgba = mcolors.to_rgba(color)
 except ValueError:
  warnings.warn((u'Ignoring invalid color %r' % color))
  return qcolor
 qcolor.setRgbF(*rgba)
 return qcolor

def to_qcolor ( color ) : qcolor = QtGui . QColor ( ) try : rgba = mcolors . to_rgba ( color ) except ValueError : warnings . warn ( ( u'Ignoring invalid color %r' % color ) ) return qcolor qcolor . setRgbF ( * rgba ) return qcolor
create a qcolor from a matplotlib color .