def calc_color_percent(min, max, temp):
    """
    Calculates the percentage of the color range that the temperature is in

    Arguments:
    min - minimum temperature
    max - maximum temperature
    temp - temperature
    """
    tp = (temp-min)/(max-min)
    if tp > 1:
      tp = 1
    if tp < 0:
      tp = 0
    return tp