def convert_color(s):
    if not isinstance(s, basestring):
        return s
    if not s.startswith('#'):
        s = _colors[s]
    l = len(s)
    if l in (4, 5):
        c = [255.0/int(x*2, 16) for x in s[1:]]
    elif l in (7, 9):
        c = [int(s[i:i+2], 16)/255.0 for i in range(1, l, 2)]
    else:
        raise ValueError('color %r has invalid length' % s)
    if len(c) < 4:
        c.append(1)
    return tuple(c)
dataset/ETHPy150Open akaihola/django-cairo-text/cairotext/templatetags/cairotext.py/convert_color/swapped operands of `/`