本文整理匯總了Python中theme.Theme.rgb_to_hex方法的典型用法代碼示例。如果您正苦於以下問題:Python Theme.rgb_to_hex方法的具體用法?Python Theme.rgb_to_hex怎麽用?Python Theme.rgb_to_hex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類theme.Theme
的用法示例。
在下文中一共展示了Theme.rgb_to_hex方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: OutputPane
# 需要導入模塊: from theme import Theme [as 別名]
# 或者: from theme.Theme import rgb_to_hex [as 別名]
#.........這裏部分代碼省略.........
self.intensity = ""
self.set_current_colours()
elif payload == "no_italic":
self.EndItalic()
elif payload == "no_underline":
self.EndUnderline()
elif payload == "no_blink":
print('Got an ANSI "no_blink"')
# TODO - remove blink-code-handles style
elif payload == "no_conceal":
print('Got an ANSI "no_conceal"')
elif payload == "no_strike":
font = self.GetFont()
font.SetStrikethrough(False)
self.BeginFont(font)
elif payload == "framed":
print('Got an ANSI "framed"')
elif payload == "encircled":
print('Got an ANSI "encircled"')
elif payload == "overline":
print('Got an ANSI "overline"')
elif payload == "no_framed_encircled":
print('Got an ANSI "no_framed_encircled"')
elif payload == "no_overline":
print('Got an ANSI "no_overline"')
elif command == "foreground" or command == "background":
if payload == "extended":
subtype = codes.pop(0)
# 24-bit color
if subtype == 2:
colour = self.theme.rgb_to_hex((codes.pop(0), codes.pop(0), codes.pop(0)))
# 256-color
elif subtype == 5:
colour = self.theme.index256_to_hex(codes.pop(0))
else:
print("Got an unknown fg/bg ANSI subtype: " + str(subtype))
else:
colour = payload
if command == "foreground":
self.fg_colour = colour
else:
self.bg_colour = colour
self.set_current_colours()
else:
print("unknown ANSI command:", command)
else:
# is a text-only chunk, check for URLs
if prefs.get("highlight_urls") == "True":
matches = re.split(utility.URL_REGEX, bit)
for chunk in matches:
if chunk is None:
continue
if re.match(utility.URL_REGEX, chunk):
self.BeginURL(chunk)
self.BeginUnderline()
current_intensity = self.intensity
self.intensity = "normal"
self.BeginTextColour(self.lookup_colour("blue"))
self.intensity = current_intensity
self.WriteText(chunk)