this.scores = scores;\r
this.min = min;\r
this.max = max;\r
+\r
+ // Make colours in constructor\r
+ // Why wasn't this done earlier?\r
+ int i, iSize=scores.length;\r
+ colors = new Color[scores.length];\r
+ for (i = 0; i < iSize; i++)\r
+ {\r
+ float red = (float) (scores[i] - (float) min) / (float) (max - min);\r
+\r
+ if (red > 1.0f)\r
+ {\r
+ red = 1.0f;\r
+ }\r
+\r
+ if (red < 0.0f)\r
+ {\r
+ red = 0.0f;\r
+ }\r
+ colors[i] = makeColour(red);\r
+ }\r
}\r
\r
/**\r
}\r
}\r
\r
- float red = (float) (scores[((Integer) ResidueProperties.aaHash.get(s)).intValue()] -\r
- (float) min) / (float) (max - min);\r
-\r
- if (red > 1.0f)\r
- {\r
- red = 1.0f;\r
- }\r
-\r
- if (red < 0.0f)\r
- {\r
- red = 0.0f;\r
- }\r
-\r
char c = s.charAt(0);\r
\r
if (jalview.util.Comparison.isGap((c)))\r
return Color.white;\r
}\r
\r
- // This isn';t great - pool of colours in here?\r
- return makeColour(red);\r
+ currentColour = colors[((Integer) ResidueProperties.aaHash.get(s)).intValue()];\r
+\r
+ if(conservationColouring)\r
+ applyConservation(j);\r
+\r
+ return currentColour;\r
}\r
\r
/**\r