def rgb2hex(rgb):
    """
    compute the hex str from an rgd triplet

    Args:
        rgb: triplet of ints between 0-255

    Returns:
        the corresponding hex str
    """
    return '#%02x%02x%02x' % rgb