1 package jalview.schemes;
3 import static org.testng.Assert.assertEquals;
7 import org.testng.annotations.Test;
9 public class TurnColourSchemeTest
12 * Turn colours are based on the scores in ResidueProperties.turn A = 0.66, R
13 * = 0.95, N = 1.56, D = 1.46... min = 0.47 max = 1.56
15 * scores are scaled to c 0-1 between min and max and colour is (c, 1-c, 1-c)
17 @Test(groups = "Functional")
18 public void testFindColour()
20 ScoreColourScheme scheme = new TurnColourScheme();
24 float a = (0.66f - min) / (max - min);
25 assertEquals(scheme.findColour('A', 0, null),
26 new Color(a, 1 - a, 1 - a));
28 float d = (1.46f - min) / (max - min);
29 assertEquals(scheme.findColour('D', 0, null),
30 new Color(d, 1 - d, 1 - d));
32 assertEquals(scheme.findColour('-', 0, null), Color.WHITE);