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


Python ColorDB.rrggbb_to_triplet方法代码示例

本文整理汇总了Python中ColorDB.rrggbb_to_triplet方法的典型用法代码示例。如果您正苦于以下问题:Python ColorDB.rrggbb_to_triplet方法的具体用法?Python ColorDB.rrggbb_to_triplet怎么用?Python ColorDB.rrggbb_to_triplet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ColorDB的用法示例。


在下文中一共展示了ColorDB.rrggbb_to_triplet方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __onrelease

# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
    def __onrelease(self, event=None):
        canvas = self.__canvas
        # find the current box
        x = canvas.canvasx(event.x)
        y = canvas.canvasy(event.y)
        ids = canvas.find_overlapping(x, y, x, y)
        for boxid in ids:
            if boxid in self.__bboxes:
                break
        else:
##            print 'No box found!'
            return
        tags = self.__canvas.gettags(boxid)
        for t in tags:
            if t[0] == '#':
                break
        else:
##            print 'No color tag found!'
            return
        red, green, blue = ColorDB.rrggbb_to_triplet(t)
        self.__dontcenter = 1
        if self.__uoc.get():
            self.__sb.update_views(red, green, blue)
        else:
            self.update_yourself(red, green, blue)
            self.__red, self.__green, self.__blue = red, green, blue
开发者ID:10sr,项目名称:cpython,代码行数:28,代码来源:ListViewer.py

示例2: scan_color

# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
 def scan_color(s, colordb=colordb):
     try:
         r, g, b = colordb.find_byname(s)
     except ColorDB.BadColor:
         try:
             r, g, b = ColorDB.rrggbb_to_triplet(s)
         except ColorDB.BadColor:
             return None, None, None
     return r, g, b
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:11,代码来源:Main.py

示例3: __select_chip

# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
 def __select_chip(self, event=None):
     x = event.x
     y = event.y
     canvas = self.__canvas
     chip = canvas.find_overlapping(x, y, x, y)
     if chip and (1 <= chip[0] <= self.__numchips):
         color = self.__chips[chip[0]-1]
         red, green, blue = ColorDB.rrggbb_to_triplet(color)
         etype = int(event.type)
         if (etype == BTNUP or self.__uwd.get()):
             # update everyone
             self.__sb.update_views(red, green, blue)
         else:
             # just track the arrows
             self.__trackarrow(chip[0], (red, green, blue))
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:17,代码来源:StripViewer.py

示例4: __set_color

# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
 def __set_color(self, event=None):
     which = self.__which.get()
     text = self.__text
     if which == 0:
         color = text['foreground']
     elif which == 1:
         color = text['background']
     elif which == 2:
         color = text['selectforeground']
     elif which == 3:
         color = text['selectbackground']
     elif which == 5:
         color = text['insertbackground']
     try:
         red, green, blue = ColorDB.rrggbb_to_triplet(color)
     except ColorDB.BadColor:
         # must have been a color name
         red, green, blue = self.__sb.colordb().find_byname(color)
     self.__sb.update_views(red, green, blue)
开发者ID:10sr,项目名称:cpython,代码行数:21,代码来源:TextViewer.py

示例5: __buttonrelease

# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
 def __buttonrelease(self, event=None):
     self.__nearest.release()
     rrggbb = self.__nearest.get_color()
     red, green, blue = ColorDB.rrggbb_to_triplet(rrggbb)
     self.__sb.update_views(red, green, blue)
开发者ID:10sr,项目名称:cpython,代码行数:7,代码来源:ChipViewer.py

示例6:

# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
"""Chip viewer and widget.
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:3,代码来源:ChipViewer.py

示例7:

# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
"""ListViewer class.
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:3,代码来源:ListViewer.py

示例8:

# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
"""TextViewer class.
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:3,代码来源:TextViewer.py

示例9:

# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
"""Strip viewer and related widgets.
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:3,代码来源:StripViewer.py

示例10:

# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
"""Pynche -- The PYthon Natural Color and Hue Editor.
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:3,代码来源:Main.py


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