def hextriplet(s):
    '\n    Wrap clldutils.color.rgb_as_hex to provide unified error handling.\n    '
    if (s in BASE_COLORS):
        return rgb_as_hex([float(d) for d in BASE_COLORS[s]])
    if (s in CSS4_COLORS):
        return CSS4_COLORS[s]
    try:
        return rgb_as_hex(s)
    except (AssertionError, ValueError) as e:
        raise ValueError('Invalid color spec: "{}" ({})'.format(s, str(e)))
Wrap clldutils.color.rgb_as_hex to provide unified error handling.
def hextriplet(s):
    '\n    \n    '
    if (s in BASE_COLORS):
        return rgb_as_hex([float(d) for d in BASE_COLORS[s]])
    if (s in CSS4_COLORS):
        return CSS4_COLORS[s]
    try:
        return rgb_as_hex(s)
    except (AssertionError, ValueError) as e:
        raise ValueError('Invalid color spec: "{}" ({})'.format(s, str(e)))