JAL-795 take colour from annotation if colour is present
[jalview.git] / src / jalview / schemes / AnnotationColourGradient.java
index f467cb8..e975884 100755 (executable)
@@ -233,14 +233,20 @@ public class AnnotationColourGradient extends FollowerColourScheme
               && !jalview.util.Comparison.isGap(c))
       {
 
-        if (predefinedColours)
+        if (annotation.annotations[j].colour != null)
         {
-          if (annotation.annotations[j].colour != null)
+          if (predefinedColours || annotation.hasIcons)
+          {
             return annotation.annotations[j].colour;
-          else
+          }
+        }
+        else
+        {
+          if (predefinedColours)
+          {
             return currentColour;
+          }
         }
-
         if (aboveAnnotationThreshold == NO_THRESHOLD
                 || (annotationThreshold != null
                         && aboveAnnotationThreshold == ABOVE_THRESHOLD && annotation.annotations[j].value >= annotationThreshold.value)