package jalview.util;
-import java.util.Locale;
-
import java.awt.Color;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
import java.util.Random;
return color;
}
-
+
/**
*
* @return random color
(int) (Math.random() * 255), (int) (Math.random() * 255));
return col;
}
+
/**
* Convert to Tk colour code format
*
colour = colour.trim();
Color col = null;
+
+ if ("random".equals(colour))
+ {
+ Random rand = new Random();
+ col = new Color(rand.nextInt(256), rand.nextInt(256),
+ rand.nextInt(256));
+ return col;
+ }
+
try
{
int value = Integer.parseInt(colour, 16);