当前位置: 首页>>代码示例>>Python>>正文


Python QColor.fromRgb方法代码示例

本文整理汇总了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)
开发者ID:chirtz,项目名称:blinkgui,代码行数:21,代码来源:bmlparser.py

示例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")))
开发者ID:timo,项目名称:colortater,代码行数:7,代码来源:rotator.py

示例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)))
开发者ID:andywyatte17,项目名称:showcase,代码行数:4,代码来源:taskmanager.py

示例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)))
开发者ID:andywyatte17,项目名称:showcase,代码行数:4,代码来源:taskmanager.py

示例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)))
开发者ID:andywyatte17,项目名称:showcase,代码行数:4,代码来源:taskmanager.py

示例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)))
开发者ID:andywyatte17,项目名称:showcase,代码行数:4,代码来源:taskmanager.py

示例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)))
开发者ID:andywyatte17,项目名称:showcase,代码行数:4,代码来源:taskmanager.py

示例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)
开发者ID:vstojkovic,项目名称:berk,代码行数:4,代码来源:__init__.py

示例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>
开发者ID:akehrer,项目名称:Motome,代码行数:33,代码来源:config.py

示例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))
开发者ID:Hasimir,项目名称:PySide,代码行数:6,代码来源:bug_617.py


注:本文中的PySide.QtGui.QColor.fromRgb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。