code: def color_table(color, N=1, sort=False, sort_values=False, inline=False, as_html=False):
      if isinstance(color, list):
          c_ = ''
          rgb_tup = [normalize(c) for c in color]
          if sort:
              rgb_tup.sort()
      elif isinstance(color, dict):
          c_ = ''
          items = [(k, normalize(v), hex_to_hsv(normalize(v)))
                   for k, v in list(color.items())]
          if sort_values:
              items = sorted(items, key=operator.itemgetter(2))
          elif sort:
              items = sorted(items, key=operator.itemgetter(0))
          rgb_tup = [(k, v) for k, v, _ in items]
      else:
          c_ = normalize(color)
          if N > 1:
              rgb_tup = np.array(color_range(c_, N))[::-1]
          else:
              rgb_tup = [c_]
      def _color(c):
          if hex_to_hsv(c)[2] < .5:
              color = "
              shadow = '0 1px 0
          else:
              color = "
              shadow = '0 1px 0 rgba(255,255,255,0.6)'
          if c == c_:
              border = " border: 1px solid
          else:
              border = ''
          return color, shadow, border
      s = '<ul style="list-style-type: none;">' if not inline else ''
      for c in rgb_tup:
          if isinstance(c, tuple):
              k, c = c
              k += ' : '
          else:
              k = ''
          if inline:
              s += '<div style="background-color:{0};height:20px;width:20px;display:inline-block;"></div>'.format(
                  c)
          else:
              color, shadow, border = _color(c)
  s +=  + border + """line-height:30px;background-color:""" + c + """;">
  <span style=" text-shadow:; color:""" + color + """;">""" + k + c.upper() + """</span>
              </li>