7ab16d909d9bbd6b55565c87f7ad7b645caa90a2 kate Thu May 5 19:54:36 2016 -0700 Tweak the new darkerLabels setting to further darken extra pale colors. diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index ad4a8b5..86db776 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -1178,31 +1178,37 @@ tdb->visibility = tg->visibility; tdb->shortLabel = cloneString(tg->shortLabel); tdb->longLabel = cloneString(tg->longLabel); tdb->grp = cloneString(tg->groupName); tdb->priority = tg->priority; tdb->canPack = tg->canPack; trackDbPolish(tdb); tg->tdb = tdb; return tg; } Color maybeDarkerLabels(struct track *track, struct hvGfx *hvg, Color color) /* For tracks having light track display but needing a darker label */ { if (trackDbSetting(track->tdb, "darkerLabels")) + { + struct hsvColor hsv = mgRgbToHsv(mgColorIxToRgb(NULL, color)); + // check if really pale + if (hsv.s < 500 ||(hsv.h > 40.0 && hsv.h < 150.0)) + return somewhatDarkerColor(hvg, color); return slightlyDarkerColor(hvg, color); + } return color; } static int doLeftLabels(struct track *track, struct hvGfx *hvg, MgFont *font, int y) /* Draw left labels. Return y coord. */ { struct slList *prev = NULL; /* for sample tracks */ double minRangeCutoff, maxRangeCutoff; double minRange, maxRange; double min0, max0; char minRangeStr[32]; char maxRangeStr[32];