/* makeRgbRainbow - List RGB values needed for rainbow of given size.. */ #include "common.h" #include "linefile.h" #include "hash.h" #include "options.h" #include "sqlNum.h" #include "rainbow.h" void usage() /* Explain usage and exit. */ { errAbort( "makeRgbRainbow - List RGB values needed for rainbow of given size.\n" "usage:\n" " makeRgbRainbow size output\n" "options:\n" " -light - If set make pastel rainbow\n" " -out=fmt Output format, one of 'tab' or 'C' or 'ra'\n" ); } static struct optionSpec options[] = { {"light", OPTION_BOOLEAN}, {"out", OPTION_STRING}, {NULL, 0}, }; boolean light = FALSE; char *out = "tab"; void makeRgbRainbow(char *sizeString, char *outFile) /* makeRgbRainbow - List RGB values needed for rainbow of given size.. */ { int i, size = sqlUnsigned(sizeString); double pos, step = 1.0/size; FILE *f = mustOpen(outFile, "w"); struct rgbColor (*colAtPos)(double pos) = (light ? lightRainbowAtPos : saturatedRainbowAtPos); for (i=0, pos=0; i