JAL-3127 always look up sequence ID colour from view when colouring by Sequence ID
authorJim Procter <jprocter@issues.jalview.org>
Tue, 16 Oct 2018 16:28:02 +0000 (17:28 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 16 Oct 2018 16:28:02 +0000 (17:28 +0100)
src/jalview/schemes/IdColourScheme.java

index a96ac0f..cd26666 100644 (file)
@@ -23,7 +23,6 @@ package jalview.schemes;
 import jalview.api.AlignViewportI;
 import jalview.datamodel.AnnotatedCollectionI;
 import jalview.datamodel.SequenceCollectionI;
-import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 
 import java.awt.Color;
@@ -74,10 +73,12 @@ public class IdColourScheme implements ColourSchemeI
   public Color findColour(char symbol, int position, SequenceI seq,
           String consensusResidue, float pid)
   {
+    // rather than testing if coll is a sequence group, and if so looking at
+    // ((SequenceGroup)coll).idColour
+    // we always return the sequence ID colour, in case the user has customised
+    // the displayed Id colour by right-clicking an internal node in the tree.
     return (view == null) ? Color.WHITE
-            : ((coll instanceof SequenceGroup)
-                    ? ((SequenceGroup) coll).idColour
-                    : view.getSequenceColour(seq));
+            : view.getSequenceColour(seq).darker();
   }
 
   @Override