def approximate(term, color_model)
      needs_approximation = (term > color_model - 1)

      if needs_approximation
        case color_model
        when 16 then nearest_term_16(term)
        when 8  then nearest_term_8(term)
        end
      else
        term
      end
    end
def approximate(term, color_model)
      needs_approximation = (term > color_model - 1)

      if needs_approximation
        case color_model
        when 16 then nearest_term_16(term)
        when 8  then nearest_term_8(term)
        end
      else
        term
      end
    end
Approximates +term+ in correspondence with +color_model+

 @see #nearest_term_16
 @see #nearest_term_8
 @param [Integer] term a colour to be approximated
 @param [Integer] color_model possible values {#to_term}
 @return [Integer] approximated number, which fits in range of color_model