JAL-2094 first pass with jalview.api.ColorI interface
[jalview.git] / src / jalview / util / ColorUtils.java
index 31d1ded..4ba17d5 100644 (file)
 
 package jalview.util;
 
+import jalview.api.ColorI;
+
 import java.awt.Color;
 import java.util.Random;
 
 public class ColorUtils
 {
 
+  public static Color getColor(ColorI c)
+  {
+    return new Color(c.getRed(), c.getGreen(), c.getBlue());
+  }
   /**
    * Generates a random color, will mix with input color. Code taken from
    * http://stackoverflow
@@ -68,7 +74,7 @@ public class ColorUtils
    *      ://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/colortool.html#
    *      tkcode
    */
-  public static final String toTkCode(Color colour)
+  public static final String toTkCode(ColorI colour)
   {
     String colstring = "#" + ((colour.getRed() < 16) ? "0" : "")
             + Integer.toHexString(colour.getRed())