From 01241ce061d53c75ff552203eb738df6bef4e1d3 Mon Sep 17 00:00:00 2001
From: tcarver <tjc>
Date: Fri, 17 Aug 2012 10:13:08 +0100
Subject: [PATCH] randomly select colours for lines

---
 .../artemis/components/alignment/LineAttributes.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/uk/ac/sanger/artemis/components/alignment/LineAttributes.java b/uk/ac/sanger/artemis/components/alignment/LineAttributes.java
index 9d1a86f95..cb4cb0355 100644
--- a/uk/ac/sanger/artemis/components/alignment/LineAttributes.java
+++ b/uk/ac/sanger/artemis/components/alignment/LineAttributes.java
@@ -39,6 +39,7 @@ import java.awt.event.ActionListener;
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 import java.util.List;
+import java.util.Random;
 
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
@@ -154,10 +155,12 @@ public class LineAttributes
         new Color(0,200,0), 
         Color.blue,
         Color.magenta,
+        new Color(204, 204, 51),
         new Color(50, 255, 255),
-        Color.yellow,
+        new Color(204, 51, 128),
+        new Color(255, 102, 0),
         Color.black };
-    LineAttributes lines[] = new LineAttributes[numPlots];
+    final LineAttributes lines[] = new LineAttributes[numPlots];
     
     if(numPlots == 1)
     {
@@ -165,12 +168,14 @@ public class LineAttributes
       return lines;
     }
     
+    final Random rand = new Random();
     for(int i=0; i<numPlots; i++)
     {
       if(i < frameColour.length)
         lines[i] = new LineAttributes(frameColour[i]);
       else
-        lines[i] = new LineAttributes(Color.black);
+        lines[i] = new LineAttributes(
+            new Color(rand.nextFloat(), rand.nextFloat(), rand.nextFloat()));
     }
     return lines;
   }
-- 
GitLab