use getHexString in util
authoramwaterhouse <Andrew Waterhouse>
Wed, 25 May 2005 16:40:38 +0000 (16:40 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 25 May 2005 16:40:38 +0000 (16:40 +0000)
src/jalview/io/HTMLOutput.java

index 76de744..50f7471 100755 (executable)
@@ -121,16 +121,9 @@ public class HTMLOutput
 \r
         if(color.getRGB()<-1)\r
         {\r
-          r = Integer.toHexString(color.getRed());\r
-          if(r.length()<2)\r
-            r = "0"+r;\r
-          g = Integer.toHexString(color.getGreen());\r
-          if(g.length()<2)\r
-            g = "0"+g;\r
-          b = Integer.toHexString(color.getBlue());\r
-          if(b.length()<2)\r
-            b = "0"+b;\r
-          out.println("<td bgcolor=\"#"+ r + g + b + "\">"+seq.getCharAt(res)+"</td>");\r
+          out.println("<td bgcolor=\"#"\r
+                      + jalview.util.Format.getHexString(color)\r
+                      + "\">"+seq.getCharAt(res)+"</td>");\r
         }\r
         else\r
           out.println("<td>"+seq.getCharAt(res)+"</td>");\r