JAL-1557 allow group associated rows to be used to create/edit current selection
[jalview.git] / src / jalview / schemes / GraduatedColor.java
index 4f1cb58..2d1c572 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.schemes;
 
+import jalview.api.FeatureColourI;
 import jalview.datamodel.SequenceFeature;
 
 import java.awt.Color;
@@ -118,6 +119,11 @@ public class GraduatedColor
     updateBounds(min, max);
   }
 
+  public GraduatedColor(FeatureColourI col)
+  {
+    setColourByLabel(col.isColourByLabel());
+  }
+
   public Color getMinColor()
   {
     return new Color(lr, lg, lb);
@@ -145,7 +151,7 @@ public class GraduatedColor
   public boolean isColored(SequenceFeature feature)
   {
     float val = feature.getScore();
-    if (val == Float.NaN)
+    if (Float.isNaN(val))
     {
       return true;
     }
@@ -153,7 +159,7 @@ public class GraduatedColor
     {
       return true;
     }
-    if (this.thrsh == Float.NaN)
+    if (Float.isNaN(this.thrsh))
     {
       return true;
     }
@@ -211,7 +217,7 @@ public class GraduatedColor
       return getMaxColor();
     }
     float scr = feature.getScore();
-    if (scr == Float.NaN)
+    if (Float.isNaN(scr))
     {
       return getMinColor();
     }