JAL-1958 modulate per-sequence shading with local score - low scores tend to grey.
authorJim Procter <jprocter@issues.jalview.org>
Mon, 16 Nov 2015 14:35:03 +0000 (14:35 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 16 Nov 2015 14:35:03 +0000 (14:35 +0000)
src/jalview/schemes/AnnotationColourGradient.java

index 8511d86..b580be2 100755 (executable)
@@ -433,18 +433,19 @@ public class AnnotationColourGradient extends FollowerColourScheme
         range = 0f;
       }
     }
-    int trans = 0;
+    // midtr sets the ceiling for bleaching out the shading
+    int trans = 0, midtr = 239;
     if (perLineScore)
     {
-      trans = (int) ((1f - range) * 255.0);
+      trans = (int) ((1f - range) * midtr);
       range = (float) ((annotation.score - plmin) / (plmax - aamin));
     }
     int dr = (int) (rr * range + r1), dg = (int) (gg * range + g1), db = (int) (bb
             * range + b1);
     if (annotation.score == annotation.score && positionToTransparency)
     {
-      return new Color(Integer.min(dr + trans, 255), Integer.min(
-              dg + trans, 255), Integer.min(db + trans, 255));
+      return new Color(Integer.min(dr + trans, midtr), Integer.min(dg
+              + trans, midtr), Integer.min(db + trans, midtr));
     }
     else
     {