def is_similar_hue(hue1, hue2, threshold):
    """
    Checks if two hues are similar
    :param hue1: Hue to check (0..360)
    :param hue2: Hue to check (0..360)
    :param threshold: Threshold until what delta hues are considered similar
    :return: Whether the hues are similar
    """
    if abs(hue1 - hue2) < threshold:
        return True
    elif abs(hue1 - 360) + hue2 < threshold:
        return True
    elif abs(hue2 - 360) + hue1 < threshold:
        return True
    else:
        return False