5de752e3fa6fd4941978107956e2a87b4c5b46ee
kate
  Thu Jul 16 12:04:16 2015 -0700
Add support for GTEX tissue color scheme. refs #15645

diff --git src/lib/rainbow.c src/lib/rainbow.c
index 95e8021..fdf5a3a 100644
--- src/lib/rainbow.c
+++ src/lib/rainbow.c
@@ -139,15 +139,31 @@
 
 struct rgbColor lightRainbowAtPos(double pos)
 /* Given pos, a number between 0 and 1, return a lightish rainbow rgbColor
  * where 0 maps to red,  0.1 is orange, and 0.9 is violet and 1.0 is back to red */
 {
 return interpolatedHue(lightRainbowTable, ArraySize(lightRainbowTable), pos);
 }
 
 struct rgbColor saturatedRainbowAtPos(double pos)
 /* Given pos, a number between 0 and 1, return a saturated rainbow rgbColor
  * where 0 maps to red,  0.1 is orange, and 0.9 is violet and 1.0 is back to red */
 {
 return interpolatedHue(saturatedRainbowTable, ArraySize(saturatedRainbowTable), pos);
 }
 
+struct rgbColor *getRainbow(struct rgbColor (*rainbowAtPos)(double pos), int size)
+/* Return array filled with rainbow of colors */
+{
+struct rgbColor *colors;
+AllocArray(colors, size);
+double invCount = 1.0/size;
+double pos;
+int i;
+for (i = 0; i < size; i++)
+    {
+    pos = invCount * i;
+    colors[i] = (*rainbowAtPos)(pos);
+    }
+return colors;
+}
+