code: def check_color(c):
      
  
      c = asarray(c)
      if c.ndim == 1:
          c = c.flatten()
          c = c[newaxis, :]
          if c.shape[1] != 3:
              raise Exception("Color must have three values per point")
      elif c.ndim == 2:
          if c.shape[1] != 3:
              raise Exception("Color array must have three values per point")
      return c
docs: Check and parse color specs as either a single [r,g,b] or a list of
      [[r,g,b],[r,g,b]...]