code: def getcolor(spec):
      
      if isinstance(spec, str):
          from matplotlib import colors
          return asarray(colors.hex2color(colors.cnames[spec]))
      else:
          return spec
docs: Turn optional color string spec into an array.