3c079f1ab5ff66233574d8c5eff421698fe6b741
angie
  Mon Aug 18 11:51:58 2014 -0700
Revert "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."
This reverts commit a4adfa326bf8bec73020ee1a8aa0cb6251ea8663.

refs #13833

diff --git src/hg/hgTracks/rnaFoldTrack.c src/hg/hgTracks/rnaFoldTrack.c
index d981abf..f6137ef 100644
--- src/hg/hgTracks/rnaFoldTrack.c
+++ src/hg/hgTracks/rnaFoldTrack.c
@@ -164,31 +164,34 @@
 		     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
-    color = colorBySpectrumOrDefault(hvg,tg,grayInRange(rnaSecStr->score,scoreMin,scoreMax),color);
+    {
+    if (tg->colorShades)
+	color = tg->colorShades[grayInRange(rnaSecStr->score, scoreMin, scoreMax)];
+    }
 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;