docstr: convert continuous values into colors using matplotlib colorscales
  :param value: value to be converted
  :param maxvalue: max value in the colorscale
  :param scale: lin, log, sqrt
  :param minvalue: minimum of the input values in linear scale (default is 0)
  :return: the color corresponding to the value
code: def to_color(self, value, maxvalue, scale, minvalue=0.0):
      """
      convert continuous values into colors using matplotlib colorscales
      :param value: value to be converted
      :param maxvalue: max value in the colorscale
      :param scale: lin, log, sqrt
      :param minvalue: minimum of the input values in linear scale (default is 0)
      :return: the color corresponding to the value
      """
  
      if scale == "lin":
          if minvalue >= maxvalue:
              raise Exception("minvalue must be less than maxvalue")
          else:
              value = 1.0 * (value - minvalue) / (maxvalue - minvalue)
      elif scale == "log":
          if value < 1 or maxvalue <= 1:
              raise Exception("value and maxvalue must be >= 1")
          else:
              value = math.log(value) / math.log(maxvalue)
      elif scale == "sqrt":
          if value < 0 or maxvalue <= 0:
              raise Exception(
                  "value and maxvalue must be greater than 0"
              )
          else:
              value = math.sqrt(value) / math.sqrt(maxvalue)
      else:
          raise Exception('scale must be "lin", "log", or "sqrt"')
  
      if value < 0:
          value = 0
      elif value > 1:
          value = 1
  
      value = int(1.0 * self.levels * value) * 1.0 / (self.levels - 1)
  
      if value not in self.mapping:
          self.mapping[value] = _convert_color_format(
              self.cmap(value), self.alpha
          )
      return self.mapping[value]
  
file_path: geoplotlib/geoplotlib/colors.py
imports: from random import shuffle
  import math
label_desc: Use image node_id 2 for calling the ColorMap obj's underlying member method code with example usage: obj.to_color(value, maxvalue, scale, minvalue) and returns: self