a4adfa326bf8bec73020ee1a8aa0cb6251ea8663
tdreszer
  Thu Jul 24 11:20:39 2014 -0700
Checking in changes to make 'spectrum' (aka 'useScore') actually work on any pair of color/altColor settings.  It used to be that only shadesOfGray, shadesOfBrown and shadesOfSea worked, leaving most cases to be shadesOfGray.  I have sat on these changes for months.  I am also checking in ifdef'd out code to calc the shade on the fly, rather than relaying on track->colorShades set of precomputed 10 shades.  The only reason this code is not used is that it would require changing many many places/uses of colorShades.  Since I am bein laid off, it seems inappropriate to make this more dramatic change at this time.
diff --git src/hg/hgTracks/rnaFoldTrack.c src/hg/hgTracks/rnaFoldTrack.c
index f6137ef..d981abf 100644
--- src/hg/hgTracks/rnaFoldTrack.c
+++ src/hg/hgTracks/rnaFoldTrack.c
@@ -164,34 +164,31 @@
 		     double scale, MgFont *font, Color color, enum trackVisibility vis)
 /* Draw a single simple rnaSecStr item at position. */
 {
 struct rnaSecStr *rnaSecStr = item;
 int heightPer = tg->heightPer;
 int x1 = round((double)((int)rnaSecStr->chromStart-winStart)*scale) + xOff;
 int x2 = round((double)((int)rnaSecStr->chromEnd-winStart)*scale) + xOff;
 int w;
 struct trackDb *tdb = tg->tdb;
 int scoreMin = atoi(trackDbSettingClosestToHomeOrDefault(tdb, "scoreMin", "0"));
 int scoreMax = atoi(trackDbSettingClosestToHomeOrDefault(tdb, "scoreMax", "1000"));
 
 if (tg->itemColor != NULL)
     color = tg->itemColor(tg, rnaSecStr, hvg);
 else
-    {
-    if (tg->colorShades)
-	color = tg->colorShades[grayInRange(rnaSecStr->score, scoreMin, scoreMax)];
-    }
+    color = colorBySpectrumOrDefault(hvg,tg,grayInRange(rnaSecStr->score,scoreMin,scoreMax),color);
 w = x2-x1;
 if (w < 1)
     w = 1;
 if (color)
     {
     if (zoomedToBaseLevel)
 	spreadRnaFoldAnno(hvg, x1, y, w, heightPer, color, font, rnaSecStr);
     else {
     hvGfxBox(hvg, x1, y, w, heightPer, color);
     colorSingleStranded(hvg, x1, y, w, heightPer, lighterColor(hvg, color), rnaSecStr);
     if (tg->subType == lfWithBarbs || tg->exonArrows)
 	{
 	int dir = 0;
 	if (rnaSecStr->strand[0] == '+')
 	    dir = 1;