MCPcopy Create free account
hub / github.com/PyQt5/PyQtClient / styleSheetCode

Method styleSheetCode

Utils/GradientUtils.py:148–161  ·  view source on GitHub ↗

颜色或渐变转字符串 :param cls: :param gradient:

(cls, colorgradient)

Source from the content-addressed store, hash-verified

146
147 @classmethod
148 def styleSheetCode(cls, colorgradient):
149 """颜色或渐变转字符串
150 :param cls:
151 :param gradient:
152 """
153 if isinstance(colorgradient, QColor):
154 return 'rgba({}, {}, {}, {})'.format(colorgradient.red(),
155 colorgradient.green(),
156 colorgradient.blue(),
157 colorgradient.alpha())
158 gradientParameters = cls._styleSheetParameters(
159 colorgradient) + cls._styleSheetStops(colorgradient)
160 return cls._styleSheetFillName(colorgradient) + '(' + ', '.join(
161 gradientParameters) + ')'

Callers 3

loadColourfulThemeMethod · 0.80
__init__Method · 0.80

Calls 3

_styleSheetParametersMethod · 0.80
_styleSheetStopsMethod · 0.80
_styleSheetFillNameMethod · 0.80

Tested by 1

__init__Method · 0.64