+ range = (annotation.annotations[j].value - annotation.threshold.value)
+ / (annotation.graphMax - annotation.threshold.value);
+ }
+ else if (thresholdIsMinMax && annotation.threshold != null
+ && aboveAnnotationThreshold == BELOW_THRESHOLD
+ && annotation.annotations[j].value >= annotation.graphMin)
+ {
+ range = (annotation.annotations[j].value - annotation.graphMin)
+ / (annotation.threshold.value - annotation.graphMin);
+ }
+ else
+ {
+ if (annotation.graphMax != annotation.graphMin)
+ {
+ range = (annotation.annotations[j].value - annotation.graphMin)
+ / (annotation.graphMax - annotation.graphMin);
+ }
+ else
+ {
+ range = 0f;
+ }
+ }
+ // midtr sets the ceiling for bleaching out the shading
+ int trans = 0, midtr = 239;
+ if (perLineScore)
+ {
+ 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, midtr), Integer.min(dg
+ + trans, midtr), Integer.min(db + trans, midtr));
+ }
+ else
+ {
+ return new Color(dr, dg, db);