code: def format(color, style=""):
      """
      Return a QTextCharFormat with the given attributes.
      """
      _color = QColor()
      if type(color) is not str:
          _color.setRgb(color[0], color[1], color[2])
      else:
          _color.setNamedColor(color)
  
      _format = QTextCharFormat()
      _format.setForeground(_color)
      if "bold" in style:
          _format.setFontWeight(QFont.Bold)
      if "italic" in style:
          _format.setFontItalic(True)
  
      return _format
  
file_path: PandasGUI/pandasgui/widgets/python_highlighter.py
imports: from PyQt5 import QtWidgets
  from PyQt5.QtCore import QRegExp
  from PyQt5.QtGui import QColor, QTextCharFormat, QFont, QSyntaxHighlighter
label_desc: Use image node_id 1 for calling a global function with example usage: format(color, style) and returns: _format