def _as256String(rgb):
    """
    Encode the given color as a 256-colors string

    Parameters:
        rgb (tuple): a tuple containing Red, Green and Blue information

    Returns:
        The encoded string
    """
    redRatio = (0 if rgb[0] < 75 else (rgb[0] - 35) / 40) * 6 * 6
    greenRatio = (0 if rgb[1] < 75 else (rgb[1] - 35) / 40) * 6 
    blueRatio = (0 if rgb[2] < 75 else (rgb[2] - 35) / 40) + 16
    return "5;{}".format(int(redRatio + greenRatio + blueRatio))