code: def to_qcolor(color):
      """Create a QColor from a matplotlib color"""
      qcolor = QtGui.QColor()
      try:
          rgba = mcolors.to_rgba(color)
      except ValueError:
          warnings.warn("Ignoring invalid color %r" % color)
          return qcolor  # return invalid QColor
      qcolor.setRgbF(*rgba)
      return qcolor
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import copy
  import datetime
  import warnings
  import six
  from matplotlib import colors
  from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
label_desc: Use image node_id 1 for calling a global function with example usage: to_qcolor(color) and returns: qcolor, qcolor