本文整理汇总了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
示例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
示例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))
示例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)
示例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)
示例6:
# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
"""Chip viewer and widget.
示例7:
# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
"""ListViewer class.
示例8:
# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
"""TextViewer class.
示例9:
# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
"""Strip viewer and related widgets.
示例10:
# 需要导入模块: import ColorDB [as 别名]
# 或者: from ColorDB import rrggbb_to_triplet [as 别名]
"""Pynche -- The PYthon Natural Color and Hue Editor.