e5606b4f483bd08425af83b289ab4c3937b333da
kate
  Thu Sep 20 13:11:03 2018 -0700
Finishing touches on geneHancer track.  Includes tool to fix incorrect ranges. refs #22048

diff --git src/lib/basicBed.c src/lib/basicBed.c
index ccfac91..cb2acdc 100644
--- src/lib/basicBed.c
+++ src/lib/basicBed.c
@@ -1013,30 +1013,40 @@
         assert(size > 1);
 	hashAdd(hash, name, bk);
         }
     }
 while (lineFileNextRow(bf, row, ArraySize(row)))
     {
     bed = bedLoadN(row, wordCount);
     bk = hashMustFindVal(hash, bed->chrom);
     binKeeperAdd(bk, bed->chromStart, bed->chromEnd, bed);
     }
 lineFileClose(&bf);
 lineFileClose(&lf);
 return hash;
 }
 
+void bedOutputRgb(FILE *f, unsigned int color)
+/*      Output a string: "r,g,b" for 24 bit number */
+{
+int colorIx = (int)color;
+struct rgbColor rgb = colorIxToRgb(colorIx);
+//fprintf(f, "%d,%d,%d", rgb.r, rgb.g, rgb.b);
+// FIXME: endian issue ??
+fprintf(f, "%d,%d,%d", rgb.b, rgb.g, rgb.r);
+}
+
 int bedParseRgb(char *itemRgb)
 /*      parse a string: "r,g,b" into three unsigned char values
         returned as 24 bit number, or -1 for failure */
 {
 char dupe[64];
 int wordCount;
 char *row[4];
 
 strncpy(dupe, itemRgb, sizeof(dupe));
 wordCount = chopString(dupe, ",", row, ArraySize(row));
 
 if ((wordCount != 3) || (!isdigit(row[0][0]) ||
     !isdigit(row[1][0]) || !isdigit(row[2][0])))
         return (-1);