b8180d9f6d41dc708a2f249ba892cbca311e7a06 jcasper Mon Feb 27 11:38:55 2023 -0800 Adding transparency support for colors refs #30569 diff --git src/hg/hgTracks/gtexTracks.c src/hg/hgTracks/gtexTracks.c index f73a98f..4acd367 100644 --- src/hg/hgTracks/gtexTracks.c +++ src/hg/hgTracks/gtexTracks.c @@ -63,35 +63,35 @@ struct gtexGeneBed *geneBed;/* Gene name, id, type, exp count and medians from BED table */ struct genePred *geneModel; /* Gene structure from model table */ char *label; /* Name, accession, or both */ char *description; /* Gene description */ double *medians1; /* Computed medians */ double *medians2; /* Computed medians for comparison (inverse) graph */ int height; /* Item height in pixels */ }; #define MAX_DESC 200 /***********************************************/ /* Color gene models using GENCODE conventions */ -static struct rgbColor codingColor = {12, 12, 120}; // #0C0C78 -static struct rgbColor nonCodingColor = {0, 100, 0}; // #006400 -static struct rgbColor pseudoColor = {255,51,255}; // #FF33FF -static struct rgbColor problemColor = {254, 0, 0}; // #FE0000 -static struct rgbColor unknownColor = {1, 1, 1}; +static struct rgbColor codingColor = {12, 12, 120, 255}; // #0C0C78 +static struct rgbColor nonCodingColor = {0, 100, 0, 255}; // #006400 +static struct rgbColor pseudoColor = {255,51,255, 255}; // #FF33FF +static struct rgbColor problemColor = {254, 0, 0, 255}; // #FE0000 +static struct rgbColor unknownColor = {1, 1, 1, 255}; static struct statusColors /* Color values for gene models */ { Color coding; Color nonCoding; Color pseudo; Color problem; Color unknown; } statusColors = {0,0,0,0}; static void initGeneColors(struct hvGfx *hvg) /* Get and cache indexes for color values */ { @@ -178,33 +178,31 @@ } struct rgbColor *getGtexTissueColors(struct track *tg, char *version) /* Get RGB colors from tissue table */ { struct gtexTissue *tissues = getTissues(tg, version); struct gtexTissue *tissue = NULL; int count = getTissueCount(tg, version); struct gtexGeneExtras *extras = (struct gtexGeneExtras *)tg->extraUiData; if (!extras->colors) { AllocArray(extras->colors, count); int i = 0; for (tissue = tissues; tissue != NULL; tissue = tissue->next) { - // TODO: reconcile - extras->colors[i] = (struct rgbColor){.r=COLOR_32_BLUE(tissue->color), .g=COLOR_32_GREEN(tissue->color), .b=COLOR_32_RED(tissue->color)}; - //colors[i] = mgColorIxToRgb(NULL, tissue->color); + extras->colors[i] = bedColorToRgb(tissue->color); i++; } } return extras->colors; } /*****************************************************************/ /* Load sample data, gene info, and anything else needed to draw */ static struct hash *loadGeneModels(char *table) /* Load gene models from table */ { struct sqlConnection *conn = hAllocConn(database); struct sqlResult *sr; char **row;