From 3edb041e2b9593c08bfcb75d9411cb6db5362546 Mon Sep 17 00:00:00 2001 From: kiramt Date: Fri, 18 Aug 2017 11:44:18 +0100 Subject: [PATCH] JAL-2664 Adjusted colour of hidden cols/seqs --- src/jalview/renderer/OverviewRenderer.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/jalview/renderer/OverviewRenderer.java b/src/jalview/renderer/OverviewRenderer.java index 48dcf3c..709816c 100644 --- a/src/jalview/renderer/OverviewRenderer.java +++ b/src/jalview/renderer/OverviewRenderer.java @@ -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(); -- 1.7.10.2