8593c40cb74ab6ee9f2318056626305d9d9544d3
braney
  Fri Apr 10 12:54:44 2026 -0700
Fix color picker from code review, refs #37329, refs #20460

- Replace Spectrum JS color picker with native HTML5 color input,
matching existing Hi-C picker
- Color saved on form submit, not immediately via AJAX
- Add checkbox to enable/disable color override; auto-checks when
user picks a color
- Gate color picker behind hg.conf showColorPicker=on (off by default)
- Only show picker for non-composite tracks that support it: bed,
bigBed, genePred, bigGenePred, wig, bigWig, rmsk, interact,
bigInteract, bigLolly, vcfTabix, vcf
- Add colorFromCart calls to interact, lolly, vcf phased, and pgSnp
drawing code
- Revert hui.js Spectrum changes from cfeb4d4 (no longer needed)
- Use htmlColorForCode()/htmlColorToRGB() from htmlColor.h instead of
hand-rolled hex parsing in colorFromCart

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

diff --git src/hg/hgTrackUi/hgTrackUi.c src/hg/hgTrackUi/hgTrackUi.c
index 5a014fe3bec..0068e030ba2 100644
--- src/hg/hgTrackUi/hgTrackUi.c
+++ src/hg/hgTrackUi/hgTrackUi.c
@@ -3437,31 +3437,37 @@
     // NOTE: these cases that fall through the cracks should probably get folded into cfgByCfgType()
     else if (startsWithWord("expRatio", tdb->type))
         expRatioUi(tdb);
     else if (startsWith("chromGraph", tdb->type))
         chromGraphUi(tdb);
     else if (startsWith("sample", tdb->type))
         genericWiggleUi(tdb,7);
     else if (startsWithWord("array",tdb->type)) // not quite the same as "expRatio" (custom tracks)
         expRatioCtUi(tdb);
     else if (startsWithWord("factorSource",tdb->type))
         factorSourceUi(db,tdb);
     else if (startsWithWord("bigBed",tdb->type))
         labelCfgUi(db, cart, tdb, tdb->track);
     }
 
-if (!tdbIsSuperTrack(tdb))
+if (!tdbIsComposite(tdb)
+    && (startsWithWord("bed", tdb->type) || startsWithWord("bigBed", tdb->type)
+    || startsWithWord("genePred", tdb->type) || startsWithWord("bigGenePred", tdb->type)
+    || startsWithWord("wig", tdb->type) || startsWithWord("bigWig", tdb->type)
+    || startsWithWord("rmsk", tdb->type) || startsWithWord("interact", tdb->type)
+    || startsWithWord("bigInteract", tdb->type) || startsWithWord("bigLolly", tdb->type)
+    || startsWithWord("vcfTabix", tdb->type) || startsWithWord("vcf", tdb->type)))
     colorTrackOption(cart, tdb->track, tdb);
 
 if (!ajax) // ajax asks for a simple cfg dialog for right-click popup or hgTrackUi subtrack cfg
     {
     // Composites *might* have had their top level controls just printed,
     // but almost certainly have additional controls
     boolean isLogo = (trackDbSetting(tdb, "logo") != NULL);
     // It'd be nice to handle faceted composites as a separate container type, but practically so much
     // of the display features we want are identical to composites - it's easier to special case the UI.
     if (tdbIsComposite(tdb) && !isLogo) // for the moment generalizing this to include other containers...
         if (!sameOk(trackDbLocalSetting(tdb, "compositeTrack"), "faceted")) // but not faceted containers ...
             hCompositeUi(db, cart, tdb, NULL, NULL, MAIN_FORM);
 
     // Additional special case navigation links may be added
     extraUiLinks(db, tdb, cart);