Kaydet (Commit) b7b1cf00 authored tarafından Barry Warsaw's avatar Barry Warsaw

rrggbb_to_triplet(): When color doesn't start with `#' raise a

BadColor exception.
üst 5b67839c
......@@ -177,7 +177,8 @@ def rrggbb_to_triplet(color, atoi=string.atoi):
"""Converts a #rrggbb color to the tuple (red, green, blue)."""
rgbtuple = _namedict.get(color)
if rgbtuple is None:
assert color[0] == '#'
if color[0] <> '#':
raise BadColor(color)
red = color[1:3]
green = color[3:5]
blue = color[5:7]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment