Merge remote-tracking branch 'origin/merge/Jalview-JS/develop_feature/JAL-3690_callba...
[jalview.git] / src / jalview / util / ColorUtils.java
index 60129fb..4305f59 100644 (file)
@@ -219,12 +219,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)