4905867d4df06d0c4cfe5769998334eaed96d6d6 braney Thu Apr 9 16:02:15 2026 -0700 Revert "Fix color picker and quickLift issues from code review, refs #37329" This reverts commit 0c4b26c76ee09cadbe1a444016f2c41df33906f9. diff --git src/hg/hgTracks/bedTrack.c src/hg/hgTracks/bedTrack.c index 5fb2f586c7f..465d76fdfe6 100644 --- src/hg/hgTracks/bedTrack.c +++ src/hg/hgTracks/bedTrack.c @@ -7,31 +7,30 @@ #include "jksql.h" #include "bed.h" #include "hdb.h" #include "bedCart.h" #include "bbiFile.h" #include "bigBed.h" #include "hgTracks.h" #include "cds.h" #include "bedTabix.h" #include "obscure.h" #include "bigBedFilter.h" #include "bigBedLabel.h" #include "snake.h" #include "liftOver.h" #include "quickLift.h" -#include "htmlColor.h" #define SEQ_DELIM '~' struct bed *bedLoadPairedTagAlign(char **row) /* Load first six fields of bed. * Add ~seq1~seq2 to end of name * Then remove the sequence to extra field when we convert to linkedFeature. * Assumes seq1 and seq2 are in row[6] and row[7], as they would be with a * pairedTagAlign type (hg/lib/encode/pairedTagAlign.as). It would be good to be * able to check these columns exist but we dont have the sqlResult here. */ { char buf[1024]; struct bed *ret = bedLoad6(row); safef(buf, sizeof(buf), "%s%c%s%c%s", ret->name, SEQ_DELIM, row[6], SEQ_DELIM, row[7]); freez(&(ret->name)); @@ -626,40 +625,40 @@ } slReverse(&lfList); if(tg->extraUiData) filterBed(tg, &lfList); slSort(&lfList, linkedFeaturesCmp); tg->items = lfList; filterItemsOnNames(tg); maybeLoadSnake(tg); // if we're in snake mode, change the methods } Color colorFromCart(struct track *tg, Color color) /* Return the RGB color from the cart setting 'colorOverride' or just return color */ { char *hexColorStr = cartOptionalStringClosestToHome(cart, tg->tdb, FALSE, "colorOverride"); -if (isEmpty(hexColorStr)) +if (hexColorStr==NULL || isEmpty(hexColorStr)) return color; -unsigned rgb; -if (!htmlColorForCode(hexColorStr, &rgb)) +if (hexColorStr[0]=='#') + hexColorStr++; +if (strlen(hexColorStr)!=6) return color; -int r, g, b; -htmlColorToRGB(rgb, &r, &g, &b); +long rgb = strtol(hexColorStr,NULL,16); // Big and little Endians tg->itemColor = NULL; tg->itemNameColor = NULL; -return MAKECOLOR_32(r, g, b); +return MAKECOLOR_32( ((rgb>>16)&0xff), ((rgb>>8)&0xff), (rgb&0xff) ); } void bedDrawSimpleAt(struct track *tg, void *item, struct hvGfx *hvg, int xOff, int y, double scale, MgFont *font, Color color, enum trackVisibility vis) /* Draw a single simple bed item at position. */ { struct bed *bed = item; int heightPer = tg->heightPer; int s = max(bed->chromStart, winStart), e = min(bed->chromEnd, winEnd); if (s > e) return; int x1 = round((s-winStart)*scale) + xOff; int x2 = round((e-winStart)*scale) + xOff; int w = x2 - x1;