src/hg/hgTracks/cds.c 1.99

1.99 2009/05/29 21:05:04 mikep
adding option to replace default 'red' tickmarks with contrasting or lighter color ones similar to the color in zoomed in base view
Index: src/hg/hgTracks/cds.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/cds.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -b -B -U 4 -r1.98 -r1.99
--- src/hg/hgTracks/cds.c	29 May 2009 19:22:45 -0000	1.98
+++ src/hg/hgTracks/cds.c	29 May 2009 21:05:04 -0000	1.99
@@ -38,8 +38,12 @@
 #endif /* GBROWSE */
 
 static char const rcsid[] = "$Id$";
 
+Color lighterShade(struct hvGfx *hvg, Color color, double percentLess);
+/* Find a color which is a percentless 'lighter' shade of color */
+/* Forward declaration */
+
 /* Array of colors used in drawing codons/bases/differences: */
 Color cdsColor[CDS_NUM_COLORS];
 boolean cdsColorsMade = FALSE;
 
@@ -279,12 +283,15 @@
 char *winDna = getCachedDna(winStart, winEnd);
 Color c = cdsColor[CDS_STOP];
 // check if we need a contrasting color instead of default 'red' (CDS_STOP)
 char *tickColor = NULL;
-if ( tg->itemColor && (tickColor = trackDbSetting(tg->tdb, "baseColorTickColor")) && sameString(tickColor, "contrastingColor"))
+if ( tg->itemColor && (tickColor = trackDbSetting(tg->tdb, "baseColorTickColor")))
     {
     Color ci = tg->itemColor(tg, lf, hvg);
+    if (sameString(tickColor, "contrastingColor"))
     c = hvGfxContrastingColor(hvg, ci);
+    else if (sameString(tickColor, "lighterShade"))
+	c = lighterShade(hvg, ci, 1.5);
     }
 for (sf = lf->components; sf != NULL; sf = sf->next)
     {
     int s = max(winStart, sf->start);