12def _format(color, style='', darker=100, lighter=100):
13 """Return a QTextCharFormat with the given attributes.
15 _color = QColor(color)
16 _color = _color.darker(darker)
17 _color = _color.lighter(lighter)
19 fmt = QTextCharFormat()
20 fmt.setForeground(_color)
22 fmt.setFontWeight(QFont.Weight.Bold)
24 fmt.setFontItalic(
True)