5dc1d6e658ab009f27314e192340275a6bb70237
max
  Tue Jun 2 16:20:48 2026 -0700
Add colorFields trackDb setting for bigBed/bigGenePred color scheme switching

Adds a new trackDb statement `colorFields` that renders a "Color by:" dropdown
in the track controls page, letting users switch among multiple pre-computed
color schemes stored as extra bigBed fields containing R,G,B strings.

The `default="label"` key renames the standard itemRgb option in the dropdown.
Other entries name extra bigBed fields whose R,G,B values override itemRgb when
selected. When a non-default scheme is active, a "(Coloring by: label)" suffix
appears in the track long label.

Changes:
- hui.c/hui.h: new colorFieldsCfgUi() rendered inside bedScoreCfgUi() for bigBed
- bigBedTrack.c: colorFieldIdx lookup + per-item filterColor override + longLabel suffix
- tagTypes.tab: register colorFields for bigBed and bigGenePred
- trackDbLibrary.shtml, trackDbDoc.html, trackDbHub.v3.html, changes.html: documentation

refs #26253

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

diff --git src/hg/inc/hui.h src/hg/inc/hui.h
index ad891259b38..68c1c25745f 100644
--- src/hg/inc/hui.h
+++ src/hg/inc/hui.h
@@ -1160,30 +1160,34 @@
 
 char *compositeViewControlNameFromTdb(struct trackDb *tdb);
 /* Returns a string with the composite view control name if one exists */
 void compositeViewControlNameFree(char **name);
 /* frees a string allocated by compositeViewControlNameFromTdb */
 
 void wigOption(struct cart *cart, char *name, char *title, struct trackDb *tdb);
 /* let the user choose to see the track in wiggle mode */
 
 void wigCfgUi(struct cart *cart, struct trackDb *tdb,char *name,char *title,boolean boxed);
 /* UI for the wiggle track */
 
 void labelCfgUi(char *db, struct cart *cart, struct trackDb *tdb, char *prefix);
 /* Put up a choice for labels. */
 
+void colorFieldsCfgUi(char *db, struct cart *cart, struct trackDb *tdb, char *prefix);
+/* If trackDb declares colorFields, render a dropdown to pick an alternative color scheme.
+ * Each colorFields entry names a bigBed extra field containing a pre-computed R,G,B string. */
+
 #define MERGESPAN_TDB_SETTING "mergeSpannedItems"
 // also used in hgTracks.js!
 #define MERGESPAN_CART_SETTING "doMergeItems"
 void mergeSpanCfgUi(struct cart *cart, struct trackDb *tdb, char *prefix);
 /* If this track offers a merge spanned items option, put up the cfg for it, which
  * is just a checkbox with a small explanation. Comparing tdb->track to prefix
  * ensures we don't offer this control at the composite level, as this is a
  * subtrack only config */
 
 #define NO_SCORE_FILTER  "noScoreFilter"
 #define  SCORE_FILTER      "scoreFilter"
 #define  SCORE_LABEL      "scoreLabel"
 #define SIGNAL_FILTER      "signalFilter"
 #define PVALUE_FILTER      "pValueFilter"
 #define QVALUE_FILTER      "qValueFilter"