# include "data.h"

int tvcolors (int argc, char **argv) {
  
  int N, kapa;
  char *name;
  KapaImageData data;

  name = NULL;
  if ((N = get_argument (argc, argv, "-n"))) {
    remove_argument (N, &argc, argv);
    name = strcreate (argv[N]);
    remove_argument (N, &argc, argv);
  }
  if (!GetImage (&data, &kapa, name)) return (FALSE);
  FREE (name);

  // use the currently-set zero,range values if not supplied
  if (argc != 2) {
    gprint (GP_ERR, "USAGE: tvcolors (colormap)\n");
    return (FALSE);
  }

  KiiSetColormap (kapa, argv[1]);
  return (TRUE);
}
