JAL-3444 transparent colour for alignment in JS
[jalview.git] / src / jalview / renderer / seqfeatures / FeatureColourFinder.java
index b92d57b..ee40d83 100644 (file)
@@ -28,7 +28,6 @@ import jalview.viewmodel.seqfeatures.FeatureRendererModel;
 
 import java.awt.Color;
 import java.awt.Graphics;
-import java.awt.Graphics2D;
 import java.awt.image.BufferedImage;
 
 /**
@@ -114,8 +113,17 @@ public class FeatureColourFinder
 
     if (g != null)
     {
+      if (Platform.isJS())
+      {
+        /*
+         * for JavaScript the pixel itself
+         * is a resource that needs to be recreated in getRGB(0,0)
+         */
+        offscreenImage.flush();
+      }
       c = new Color(offscreenImage.getRGB(0, 0));
     }
+
     return c;
   }