本文整理汇总了Python中PySide.QtGui.QColor.fromRgb方法的典型用法代码示例。如果您正苦于以下问题:Python QColor.fromRgb方法的具体用法?Python QColor.fromRgb怎么用?Python QColor.fromRgb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QColor
的用法示例。
在下文中一共展示了QColor.fromRgb方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_xml
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import fromRgb [as 别名]
def write_xml(self, frames, file_name):
for frame in frames:
frame_elem = etree.Element("frame")
frame_elem.set("duration", str(frame.duration))
tile_count = 0
row = etree.Element("row")
row_text = ""
for color in frame.tile_colors:
tile_count += 1
row_text += str(QColor.fromRgb(*color).name()[1:])
if tile_count == self.width:
tile_count = 0
row.text = row_text
frame_elem.append(row)
row = etree.Element("row")
row_text = ""
self.blm_root.append(frame_elem)
tree = etree.ElementTree(self.blm_root)
tree.write(file_name)
示例2: parse_color
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import fromRgb [as 别名]
def parse_color(match):
if match.group("hexcolor"):
return QColor(match.group("hexcolor"))
elif match.group("rgbfunc"):
return QColor.fromRgb(int(match.group("r")), int(match.group("g")), int(match.group("b")))
示例3: Gray
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import fromRgb [as 别名]
def Gray(self):
return color_type(htmlCol="#777",qbrush=QBrush(QColor.fromRgb(0x77,0x77,0x77)))
示例4: Blue
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import fromRgb [as 别名]
def Blue(self):
return color_type(htmlCol="#00f",qbrush=QBrush(QColor.fromRgb(0,0,0xff)))
示例5: Green
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import fromRgb [as 别名]
def Green(self):
return color_type(htmlCol="#070",qbrush=QBrush(QColor.fromRgb(0,0x77,0)))
示例6: Red
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import fromRgb [as 别名]
def Red(self):
return color_type(htmlCol="#000",qbrush=QBrush(QColor.fromRgb(0xff,0,0)))
示例7: Black
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import fromRgb [as 别名]
def Black(self):
return color_type(htmlCol="#000", qbrush=QBrush(QColor.fromRgb(0,0,0)))
示例8: rgb_color
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import fromRgb [as 别名]
def rgb_color(rgb):
return QColor.fromRgb(rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff)
示例9:
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import fromRgb [as 别名]
# the character prepended to tag values when searching
TAG_QUERY_CHAR = '#'
# unsafe filename characters, being pretty strict
UNSAFE_CHARS = '<>:"/\|?*#'
# the unicode end of text character
# http://www.fileformat.info/info/unicode/char/0003/index.htm
# This signifies where the note content ends and any metadata begins
END_OF_TEXT = '\u0003' # Only applies to pre 0.2 versions
# the YAML bracket that splits the files metadata
YAML_BRACKET = '---'
# colors
MOTOME_BLUE = QColor.fromRgb(38, 87, 127, a=255)
MOTOME_LTBLUE = QColor.fromRgb(145, 177, 203, a=255)
MOTOME_GRYBLUE = QColor.fromRgb(89, 122, 148, a=255)
MOTOME_BRTBLUE = QColor.fromRgb(61, 139, 203, a=255)
HIGHLIGHT_COLOR = QColor.fromRgb(255, 255, 153, a=255)
# diff status template, to show when at current note record
STATUS_TEMPLATE = """
<html>
<body>
<p>
{notename}
</p>
<p>
This is the latest version.
</p>
示例10: testRepr
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import fromRgb [as 别名]
def testRepr(self):
c = QColor.fromRgb(1, 2, 3, 4)
s = c.spec()
self.assertEqual(repr(s), repr(QColor.Rgb))