Krita Source Code Documentation
Loading...
Searching...
No Matches
scripter.ui_scripter.syntax.syntaxstyles Namespace Reference

Classes

class  BlenderSyntaxStyle
 
class  BreezeDarkSyntaxStyle
 
class  BreezeLightSyntaxStyle
 
class  DefaultSyntaxStyle
 
class  PythonVimSyntaxStyle
 
class  SolarizedDarkSyntaxStyle
 
class  SolarizedLightSyntaxStyle
 

Functions

 _format (color, style='', darker=100, lighter=100)
 

Detailed Description

SPDX-FileCopyrightText: 2017 Eliakin Costa <eliakim170@gmail.com>

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ _format()

scripter.ui_scripter.syntax.syntaxstyles._format ( color,
style = '',
darker = 100,
lighter = 100 )
protected
Return a QTextCharFormat with the given attributes.

Definition at line 12 of file syntaxstyles.py.

12def _format(color, style='', darker=100, lighter=100):
13 """Return a QTextCharFormat with the given attributes.
14 """
15 _color = QColor(color)
16 _color = _color.darker(darker)
17 _color = _color.lighter(lighter)
18
19 fmt = QTextCharFormat()
20 fmt.setForeground(_color)
21 if 'bold' in style:
22 fmt.setFontWeight(QFont.Weight.Bold)
23 if 'italic' in style:
24 fmt.setFontItalic(True)
25
26 return fmt
27
28