2961c25331a73eba4ddbca0b848b43e4a467fa75 chmalee Thu Jul 23 11:12:40 2026 -0700 Trying this again. Let users use a rightclick option to change the color of single bed-like items, gated via hg.conf setting canColorItems, refs #37778 diff --git src/hg/hgTracks/hgTracks.h src/hg/hgTracks/hgTracks.h index 78db044769a..94c978a7b61 100644 --- src/hg/hgTracks/hgTracks.h +++ src/hg/hgTracks/hgTracks.h @@ -1627,30 +1627,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