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/bedTrack.c src/hg/hgTracks/bedTrack.c index dc7f6c6..3b3dd41 100644 --- src/hg/hgTracks/bedTrack.c +++ src/hg/hgTracks/bedTrack.c @@ -499,34 +499,34 @@ int x2 = round((e-winStart)*scale) + xOff; int w = x2 - x1; if (w < 1) w = 1; struct trackDb *tdb = tg->tdb; int scoreMin = atoi(trackDbSettingClosestToHomeOrDefault(tdb, "scoreMin", "0")); int scoreMax = atoi(trackDbSettingClosestToHomeOrDefault(tdb, "scoreMax", "1000")); char *directUrl = trackDbSetting(tdb, "directUrl"); boolean withHgsid = (trackDbSetting(tdb, "hgsid") != NULL); boolean thickDrawItem = (trackDbSetting(tdb, "thickDrawItem") != NULL); if (tg->itemColor != NULL) { color = tg->itemColor(tg, bed, hvg); } -else if (tg->colorShades) +else { adjustBedScoreGrayLevel(tdb, bed, scoreMin, scoreMax); - color = tg->colorShades[grayInRange(bed->score, scoreMin, scoreMax)]; + color = colorBySpectrumOrDefault(hvg,tg,grayInRange(bed->score, scoreMin, scoreMax),color); } /* Keep the item at least 4 pixels wide at all viewpoints */ if (thickDrawItem && (w < 4)) { x1 -= ((5-w) >> 1); w = 4; x2 = x1 + w; } if (color) { hvGfxBox(hvg, x1, y, w, heightPer, color); if (tg->drawName && vis != tvSquish) { /* Clip here so that text will tend to be more visible... */ char *s = tg->itemName(tg, bed);