abd7278ac7167ede325d8c144a35ea59a0798766
chmalee
  Wed Jun 17 03:55:47 2026 -0700
Add a right click option to change color or background highlight color of individual track items. Only works for bed like items, refs #37778

diff --git src/hg/hgTracks/hgTracks.h src/hg/hgTracks/hgTracks.h
index 9a0a35755ab..1637adb89ca 100644
--- src/hg/hgTracks/hgTracks.h
+++ src/hg/hgTracks/hgTracks.h
@@ -1623,30 +1623,39 @@
 /* Return a string that contains all the UI state in CGI var
  * format.  If toggleGroup is non-null the visibility of that
  * track will be toggled in the string. */
 
 boolean nextItemCompatible(struct track *tg);
 /* Check to see if we draw nextPrev item buttons on a track. */
 
 void linkedFeaturesLabelNextPrevItem(struct track *tg, boolean next);
 /* Default next-gene function for linkedFeatures.  Changes winStart/winEnd
  * and updates position in cart. */
 
 void createHgFindMatchHash();
 /* Read from the cart the string assocated with matches and
    put the matching items into a hash for highlighting later. */
 
+void createItemColorHash();
+/* Read the itemColors cart variable into a hash of per-item colors keyed by "track\titemName",
+ * keeping only records for the current database. Each color either recolors the whole item glyph
+ * or draws a background highlight, per the record's mode. */
+
+boolean itemColorOverride(struct track *tg, void *item, Color *retColor, boolean *retWholeItem);
+/* If the user set a per-item color for this item (via right-click), return TRUE and fill in the
+ * color and whether it recolors the whole item; otherwise return FALSE. */
+
 TrackHandler lookupTrackHandlerClosestToHome(struct trackDb *tdb);
 /* Lookup handler for track of give name.  Try parents if
  * subtrack has a NULL handler.  Return NULL if none. */
 
 void registerTrackHandlers();
 /* Register tracks that include some non-standard methods. */
 
 void initColors(struct hvGfx *hvg);
 /* Initialize the shades of gray etc. */
 
 void findTrackColors(struct hvGfx *hvg, struct track *trackList);
 /* Find colors to draw in. */
 
 char *getItemDataName(struct track *tg, char *itemName);
 /* Translate an itemName to its itemDataName, using tg->itemDataName if is not