def tscheme_rgb(red, green, blue):
"""Return a color from red, green, and blue values from 0 to 1."""
colors = (red, green, blue)
for x in colors:
if x < 0 or x > 1:
raise SchemeError("Illegal color intensity in " + str(colors))
scaled = tuple(int(x*255) for x in colors)
return '"#%02x%02x%02x"' % scaled
评论列表
文章目录