X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FGraduatedColor.java;h=f629d091558f3afab005c7be515a585892885408;hb=d8084ce0043bb2454cfc48fe9c87f9aef12c0cf8;hp=2d1c572ae8028c9561029da05b63bb8c5201cc47;hpb=2facc9ee2fdb025b5cc79b005e7eb5bd915cd9ba;p=jalview.git diff --git a/src/jalview/schemes/GraduatedColor.java b/src/jalview/schemes/GraduatedColor.java index 2d1c572..f629d09 100644 --- a/src/jalview/schemes/GraduatedColor.java +++ b/src/jalview/schemes/GraduatedColor.java @@ -34,6 +34,11 @@ import java.awt.Color; */ public class GraduatedColor { + private static final Color[] colours = new Color[] { Color.blue, + Color.red }; + + private static int colourModulus = 0; + int thresholdState = AnnotationColourGradient.NO_THRESHOLD; // or // ABOVE_THRESHOLD // or @@ -104,6 +109,7 @@ public class GraduatedColor thrsh = oldcs.thrsh; autoScale = oldcs.autoScale; colourByLabel = oldcs.colourByLabel; + colourAlternately = oldcs.colourAlternately; } /** @@ -182,6 +188,8 @@ public class GraduatedColor private boolean colourByLabel = false; + private boolean colourAlternately = false; + /** * * @return true if colourByLabel style is set @@ -212,6 +220,12 @@ public class GraduatedColor } return ucs.createColourFromName(feature.getDescription()); } + if (colourAlternately) + { + int minOrMax = feature.getFeatureNumber() % 2; + return minOrMax == 0 ? new Color(lr, lg, lb) : new Color(lr + dr, lg + + dg, lb + db); + } if (range == 0.0) { return getMaxColor(); @@ -301,4 +315,14 @@ public class GraduatedColor tolow = false; } } + + public boolean isColourAlternately() + { + return colourAlternately; + } + + public void setColourAlternately(boolean colourAlternately) + { + this.colourAlternately = colourAlternately; + } }