X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Frenderer%2FResidueShader.java;h=c0311700f1e61e5afc93c16984a6d8b98f14d5c5;hb=be38fa8acaa8061b501a4e94fb7dea4b7ed8ed41;hp=b381f325fcc3a6b44861d2e0491fbe4cd9bb3810;hpb=3d0101179759ef157b088ea135423cd909512d9f;p=jalview.git diff --git a/src/jalview/renderer/ResidueShader.java b/src/jalview/renderer/ResidueShader.java index b381f32..c031170 100644 --- a/src/jalview/renderer/ResidueShader.java +++ b/src/jalview/renderer/ResidueShader.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.renderer; import jalview.analysis.Conservation; @@ -215,6 +235,11 @@ public class ResidueShader implements ResidueShaderI @Override public Color findColour(char symbol, int position, SequenceI seq) { + if (colourScheme == null) + { + return Color.white; // Colour is 'None' + } + /* * get 'base' colour */ @@ -223,14 +248,16 @@ public class ResidueShader implements ResidueShaderI : profile.getModalResidue(); float pid = profile == null ? 0f : profile.getPercentageIdentity(ignoreGaps); - Color colour = colourScheme == null ? Color.white - : colourScheme.findColour(symbol, position, seq, modalResidue, - pid); + Color colour = colourScheme.findColour(symbol, position, seq, + modalResidue, pid); /* * apply PID threshold and consensus fading if in force */ - colour = adjustColour(symbol, position, colour); + if (!Comparison.isGap(symbol)) + { + colour = adjustColour(symbol, position, colour); + } return colour; }