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) diff --git src/hg/hgTracks/lollyTrack.c src/hg/hgTracks/lollyTrack.c index 85758a5fec4..bc714061350 100644 --- src/hg/hgTracks/lollyTrack.c +++ src/hg/hgTracks/lollyTrack.c @@ -1,548 +1,550 @@ /* lollyTrack -- load and draw lollys */ /* Copyright (C) 2019 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #include "common.h" #include "obscure.h" #include "hgTracks.h" #include "bedCart.h" #include "bigWarn.h" #include "lolly.h" #include "limits.h" #include "float.h" #include "bigBedFilter.h" #include "asParse.h" #include "quickLift.h" #define LOLLY_DIAMETER 2 * (lollyCart->radius + 2) struct lolly { struct lolly *next; char *name; /* the mouseover name */ double val; /* value in the data file */ unsigned start; /* genomic start address */ unsigned end; /* genomic end address */ unsigned radius; /* radius of the top of the lolly */ unsigned height; /* height of the lolly */ Color color; /* color of the lolly */ char *mouseOver; }; static unsigned getLollyColor( struct hvGfx *hvg, unsigned color) /* Get the device color from our internal definition. */ { struct rgbColor itemRgb; itemRgb.r = (color & 0xff0000) >> 16; itemRgb.g = (color & 0xff00) >> 8; itemRgb.b = color & 0xff; return hvGfxFindColorIx(hvg, itemRgb.r, itemRgb.g, itemRgb.b); } // structure to capture yLabels struct yLabel { struct yLabel *next; unsigned y; char *label; unsigned long color; boolean on; }; int cmpY(const void *va, const void *vb) // sort the lines by y value { const struct yLabel *a = *((struct yLabel **)va); const struct yLabel *b = *((struct yLabel **)vb); return a->y - b->y; } // font heights available to the user unsigned fontHeights[] = { 6,8,10,12,14,18,24 ,34 }; unsigned findBiggest(unsigned num) /* find biggest font not bigger than num */ { int ii; unsigned prev = 6; for (ii=0; ii < ArraySize(fontHeights); prev = fontHeights[ii], ii++) if (fontHeights[ii] > num) return prev; return 34; } void doYLabels(struct track *tg, struct hvGfx *hvg, int width, int height, struct lollyCartOptions *lollyCart, int xOff, int yOff, Color color, MgFont *font, boolean doLabels ) /* parse lines like yAxisLabel