MCPcopy Create free account
hub / github.com/PyQt5/PyQt / __getColor

Method __getColor

Test/ChartView/ChartView.py:74–86  ·  view source on GitHub ↗

:param color: int|str|[r,g,b]|[r,g,b,a]

(self, color=None, default=Qt.white)

Source from the content-addressed store, hash-verified

72 print(points)
73
74 def __getColor(self, color=None, default=Qt.white):
75 '''
76 :param color: int|str|[r,g,b]|[r,g,b,a]
77 '''
78 if not color:
79 return QColor(default)
80 if isinstance(color, QBrush):
81 return color
82 # 比如[r,g,b]或[r,g,b,a]
83 if isinstance(color, list) and 3 <= len(color) <= 4:
84 return QColor(*color)
85 else:
86 return QColor(color)
87
88 def __getPen(self, pen=None, default=QPen(
89 Qt.white, 1, Qt.SolidLine,

Callers 3

__getPenMethod · 0.95
__setTitleMethod · 0.95
__setBackgroundMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected