Merge commit 'alpha/update_2_12_for_2_11_2_series_merge^2' into HEAD
[jalview.git] / src / jalview / util / ColorUtils.java
index 5db333f..85a0b6c 100644 (file)
@@ -221,12 +221,15 @@ public class ColorUtils
     colour = colour.trim();
 
     Color col = null;
-    try
-    {
-      int value = Integer.parseInt(colour, 16);
-      col = new Color(value);
-    } catch (NumberFormatException ex)
+    if (StringUtils.isHexString(colour))
     {
+      try
+      {
+        int value = Integer.parseInt(colour, 16);
+        col = new Color(value);
+      } catch (NumberFormatException ex)
+      {
+      }
     }
 
     if (col == null)