JAL-2664 Adjusted colour of hidden cols/seqs
authorkiramt <k.mourao@dundee.ac.uk>
Fri, 18 Aug 2017 10:44:18 +0000 (11:44 +0100)
committerkiramt <k.mourao@dundee.ac.uk>
Fri, 18 Aug 2017 10:44:18 +0000 (11:44 +0100)
src/jalview/renderer/OverviewRenderer.java

index 48dcf3c..709816c 100644 (file)
@@ -37,6 +37,9 @@ import java.awt.image.BufferedImage;
 
 public class OverviewRenderer
 {
+  // transparency of hidden cols/seqs overlay
+  private final float TRANSPARENCY = 0.5f;
+
   private FeatureColourFinder finder;
 
   private jalview.api.SequenceRenderer sr;
@@ -157,11 +160,16 @@ public class OverviewRenderer
     return color.getRGB();
   }
 
+  /*
+   * Overlay a buffered image (mask) onto another image (image) where mask 
+   * has some transparency so image shows through from below
+   */
   private BufferedImage applyMask(BufferedImage mask, BufferedImage image)
   {
     Graphics2D g = (Graphics2D) image.getGraphics();
     g.setComposite(
-            AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
+            AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
+                    TRANSPARENCY));
     g.drawImage(mask, 0, 0, image.getWidth(), image.getHeight(), null);
     return image;
   }
@@ -180,7 +188,7 @@ public class OverviewRenderer
     int colIndex = 0;
     int pixelCol = 0;
 
-    Color hidden = Color.DARK_GRAY;
+    Color hidden = Color.DARK_GRAY.darker();
 
     Graphics2D g2d = (Graphics2D) hiddenImage.getGraphics();