b8180d9f6d41dc708a2f249ba892cbca311e7a06
jcasper
  Mon Feb 27 11:38:55 2023 -0800
Adding transparency support for colors refs #30569

diff --git src/hg/hgTracks/interactTrack.c src/hg/hgTracks/interactTrack.c
index d701be3..13fadc4 100644
--- src/hg/hgTracks/interactTrack.c
+++ src/hg/hgTracks/interactTrack.c
@@ -21,41 +21,32 @@
                                 INTERACT_MINHEIGHT, INTERACT_MAXHEIGHT, atoi(INTERACT_DEFHEIGHT),
                                 &min, &max, &deflt, &current);
 return tg->height = current;
 }
 
 static Color interactItemColor(struct track *tg, void *item, struct hvGfx *hvg, int scoreMin, int scoreMax)
 /* Return color to draw an interaction */
 {
 struct interact *inter = item;
 if (tg->colorShades)
     {
     struct bed *bed = (struct bed *)inter;
     adjustBedScoreGrayLevel(tg->tdb, bed, scoreMin, scoreMax);
     return tg->colorShades[grayInRange(inter->score, 0, 1000)];
     }
-/*
- There must be a better way..., e.g.:
-
-unsigned red = COLOR_32_RED(inter->color);
-unsigned green = COLOR_32_GREEN(inter->color);
-unsigned blue = COLOR_32_BLUE(inter->color);
-*/
-unsigned red = (inter->color & 0xff0000) >> 16;
-unsigned green = (inter->color & 0xff00) >> 8;
-unsigned blue = inter->color & 0xff;
-return hvGfxFindColorIx(hvg, red, green, blue);
+struct rgbColor color = bedColorToRgb(inter->color);
+return hvGfxFindAlphaColorIx(hvg, color.r, color.g, color.b, color.a);
 }
 
 boolean interactSourceInWindow(struct interact *inter)
 /* True if midpoint of source is on screen */
 {
 unsigned s = interactRegionCenter(inter->sourceStart, inter->sourceEnd);
 return (s >= winStart) && (s < winEnd);
 }
 
 boolean interactTargetInWindow(struct interact *inter)
 /* True if midpoint of target is on screen */
 {
 unsigned t = interactRegionCenter(inter->targetStart, inter->targetEnd);
 return (t >= winStart) && (t < winEnd);
 }