b8180d9f6d41dc708a2f249ba892cbca311e7a06 jcasper Mon Feb 27 11:38:55 2023 -0800 Adding transparency support for colors refs #30569 diff --git src/hg/mouseStuff/mousePoster/mousePoster.c src/hg/mouseStuff/mousePoster/mousePoster.c index 74bee28..9ed84a5 100644 --- src/hg/mouseStuff/mousePoster/mousePoster.c +++ src/hg/mouseStuff/mousePoster/mousePoster.c @@ -60,34 +60,34 @@ /* Resolved duplications file. */ char *bestDupFile = "/cluster/store2/mm.2002.02/mm2/bed/poster/dupe.rpt"; /* Misplaced gene file. */ char *misplacedFile = "/cluster/store2/mm.2002.02/mm2/bed/poster/misplace.rpt"; /* Unresolved dupe output. */ FILE *dupeFile; char *dupeFileName = "dupes.out"; /* Centromere/big gap info. Obsolete as of October 2000 assembly. */ //char *gapFile = "centro.tab"; /* Some colors. */ -struct rgbColor rgbRed = {240,0,0}; -struct rgbColor rgbRedOrange = {240, 100, 0}; -struct rgbColor rgbYellow = {255, 255, 0}; -static struct rgbColor blueGene = { 0, 0, 160}; +struct rgbColor rgbRed = {240,0,0, 255}; +struct rgbColor rgbRedOrange = {240, 100, 0, 255}; +struct rgbColor rgbYellow = {255, 255, 0, 255}; +static struct rgbColor blueGene = { 0, 0, 160, 255}; void usage() /* Explain usage and exit. */ { errAbort( "mousePoster - Search database info for making foldout\n" "usage:\n" " mousePoster chrM chrN ...\n" "Note - you'll need to edit the source to use different data\n"); } struct chromGaps /* Placeholder for obsolete structure. */ { struct chromGaps *next; @@ -412,34 +412,34 @@ void getKnownGenes(struct chromGaps *cg, char *chrom, struct sqlConnection *conn, FILE *f, struct hash *dupHash, struct hash *resolvedDupHash, struct hash *yellowHash, struct hash *redHash, struct hash *greenHash, struct hash *misplacedHash) /* Get info on known genes. */ { int rowOffset; struct sqlResult *sr; char **row; char query[256]; struct genePred *gpList = NULL, *gp; char geneName[64]; -static struct rgbColor red = {255, 0, 0}; -static struct rgbColor green = {0, 190, 0}; -static struct rgbColor yellow = {190, 150, 0}; -static struct rgbColor blue = {0, 0, 220}; +static struct rgbColor red = {255, 0, 0, 255}; +static struct rgbColor green = {0, 190, 0, 255}; +static struct rgbColor yellow = {190, 150, 0, 255}; +static struct rgbColor blue = {0, 0, 220, 255}; struct rgbColor *col; boolean keepGene; struct dlList *geneList = newDlList(); struct dlNode *node; struct knownGene *kg; printf(" finding known genes for %s, chrom\n", chrom); /* Get list of known genes. */ sr = hChromQuery(conn, "refGene", chrom, NULL, &rowOffset); while ((row = sqlNextRow(sr)) != NULL) { gp = genePredLoad(row + rowOffset); slAddHead(&gpList, gp); } @@ -973,56 +973,56 @@ int chromNum(char *chrom) /* Convert chrN to N, also handle X and Y. */ { char c; if (startsWith("chr", chrom)) chrom += 3; c = chrom[0]; if (c == 'X') return 23; if (c == 'Y') return 24; return atoi(chrom); } static struct rgbColor chromColorTable[] = { - { 0,0, 0}, - { 255,204, 204}, /* light red */ - { 204,0, 0}, /* med red */ - { 255,0, 0}, /* bright red */ - { 255,102,0}, /* bright orange */ - { 255,153,0}, /* yellow orange */ - { 255,0,204}, /* magenta */ - { 255,255,204}, /* light yellow */ - { 255,255,153}, /* med yellow */ - { 255,255,0}, /* bright yellow*/ - { 0,255,0}, /*bt gr*/ - { 204,255,0}, /* yellow green */ - { 102,102,0}, /* dark green*/ - { 204,255,255}, /*lt cyan*/ - { 153,204,204}, /* gray cyan */ - { 0,255,255}, /*med cyan*/ - { 153,204,255}, /*light med blue */ - { 102,153,255}, /* med blue */ - { 0,0 ,204}, /* deep blue */ - { 204,153,255}, /*lt violet*/ - { 204,051,255}, /* med violet */ - { 153,0,204}, /* dark violet */ - { 204,204,204}, /* light gray */ - { 153,153,153}, /* med gray */ - { 102,102,102}, /* dark gray */ - { 255,255,255}, /* black */ + { 0,0, 0, 255}, + { 255,204, 204,255}, /* light red */ + { 204,0, 0,255}, /* med red */ + { 255,0, 0,255}, /* bright red */ + { 255,102,0,255}, /* bright orange */ + { 255,153,0,255}, /* yellow orange */ + { 255,0,204,255}, /* magenta */ + { 255,255,204,255}, /* light yellow */ + { 255,255,153,255}, /* med yellow */ + { 255,255,0,255}, /* bright yellow*/ + { 0,255,0,255}, /*bt gr*/ + { 204,255,0,255}, /* yellow green */ + { 102,102,0,255}, /* dark green*/ + { 204,255,255,255}, /*lt cyan*/ + { 153,204,204,255}, /* gray cyan */ + { 0,255,255,255}, /*med cyan*/ + { 153,204,255,255}, /*light med blue */ + { 102,153,255,255}, /* med blue */ + { 0,0 ,204,255}, /* deep blue */ + { 204,153,255,255}, /*lt violet*/ + { 204,051,255,255}, /* med violet */ + { 153,0,204,255}, /* dark violet */ + { 204,204,204,255}, /* light gray */ + { 153,153,153,255}, /* med gray */ + { 102,102,102,255}, /* dark gray */ + { 255,255,255,255}, /* black */ }; struct rgbColor *chromColor(char *chrom) /* Return color for chromosome. */ { int ix = chromNum(chrom); assert(ix < ArraySize(chromColorTable)); return &chromColorTable[ix]; } void getSynteny(struct chromGaps *cg, char *chrom, FILE *f) /* Read synteny file and put relevant parts in output */ { struct sqlConnection *hConn = sqlConnect(humanDb); struct lineFile *lf = lineFileOpen(syntenyFile, TRUE);