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/bamTrack.c src/hg/hgTracks/bamTrack.c index 83699e6..b6ecf69 100644 --- src/hg/hgTracks/bamTrack.c +++ src/hg/hgTracks/bamTrack.c @@ -594,46 +594,43 @@ static Color darkBlueColor = 0; static Color darkRedColor = 0; if (darkRedColor == 0) { darkRedColor = hvGfxFindColorIx(hvg, 100,0,0); darkBlueColor = hvGfxFindColorIx(hvg, 0,0,100); } if (sameString(colorMode, BAM_COLOR_MODE_STRAND)) color = (lf->orientation < 0) ? darkRedColor : darkBlueColor; else if (lf->filterColor != 0) { // In bamTrack, lf->filterColor is an RGBA value color = lf->filterColor; } -else if (tg->colorShades) - color = tg->colorShades[lf->grayIx]; -else - color = tg->ixColor; + color = colorBySpectrumOrDefault(hvg,tg,lf->grayIx,tg->ixColor); indelEnabled(cart, tg->tdb, basesPerPixel, &indelShowDoubleInsert, &indelShowQueryInsert, &indelShowPolyA); if (!indelShowDoubleInsert) innerLine(hvg, x1, midY, w, color); for (sf = lf->components; sf != NULL; sf = sf->next) { int s = sf->start, e = sf->end; if (e <= s || e < winStart || s > winEnd) continue; if (baseQualMode) - color = tg->colorShades[sf->grayIx]; + color = colorBySpectrumOrDefault(hvg,tg,sf->grayIx,color); baseColorDrawItem(tg, lf, sf->grayIx, hvg, xOff, y, scale, font, s, e, heightPer, zoomedToCodonLevel, mrnaSeq, sf, psl, drawOpt, MAXPIXELS, winStart, color); if (tg->exonArrowsAlways || (exonArrows && (sf->start <= winStart || sf->start == lf->start) && (sf->end >= winEnd || sf->end == lf->end))) { Color barbColor = hvGfxContrastingColor(hvg, color); x1 = round((double)((int)s-winStart)*scale) + xOff; x2 = round((double)((int)e-winStart)*scale) + xOff; w = x2-x1; clippedBarbs(hvg, x1+1, midY, x2-x1-2, tl.barbHeight, tl.barbSpacing, lf->orientation, barbColor, TRUE); } }