def valid_color(color_value, range_min, range_max):
    """Checks that the color value is within the range of validity.

    Each polynomial fit has a different range of validity. We need to
    make sure that the color we are feeding in is inside that range.

    Args:
        color_value (float): B-V, V-I, or B-I color of the supernova in
            magnitudes (corrected for reddening and extinction from the
            host and MWG.)
        range_min (float): Minumum value of the color range over which the fit
            is valid
        range_max (float): Maxumum value of the color range over which the fit
            is valid

    Returns:
        bool: True if the color value is within the valid range.
        False if the volor value is outside the valid range.
   """
    if range_min <= color_value <= range_max:
        return True
    else:
        return False
