parameters: (color, style='', darker=100, lighter=100)
return_statement: return fmt
docstring: Return a QTextCharFormat with the given attributes.
docstring_summary: Return a QTextCharFormat with the given attributes.
docstring_tokens: Return a QTextCharFormat with the given attributes .
function: def _format(color, style='', darker=100, lighter=100):
      """Return a QTextCharFormat with the given attributes.
      """
      _color = QColor(color)
      _color = _color.darker(darker)
      _color = _color.lighter(lighter)
  
      fmt = QTextCharFormat()
      fmt.setForeground(_color)
      if 'bold' in style:
          fmt.setFontWeight(QFont.Bold)
      if 'italic' in style:
          fmt.setFontItalic(True)
  
      return fmt
function_tokens: def _format ( color , style = '' , darker = 100 , lighter = 100 ) : _color = QColor ( color ) _color = _color . darker ( darker ) _color = _color . lighter ( lighter ) fmt = QTextCharFormat ( ) fmt . setForeground ( _color ) if 'bold' in style : fmt . setFontWeight ( QFont . Bold ) if 'italic' in style : fmt . setFontItalic ( True ) return fmt