Merge commit 'alpha/update_2_12_for_2_11_2_series_merge^2' into HEAD
[jalview.git] / src / jalview / util / ColorUtils.java
index c1feeee..85a0b6c 100644 (file)
@@ -24,6 +24,8 @@
 
 package jalview.util;
 
+import java.util.Locale;
+
 import java.awt.Color;
 import java.util.HashMap;
 import java.util.Map;
@@ -219,7 +221,7 @@ public class ColorUtils
     colour = colour.trim();
 
     Color col = null;
-    if (colour.length() == 6 && StringUtils.isHexString(colour))
+    if (StringUtils.isHexString(colour))
     {
       try
       {
@@ -255,10 +257,6 @@ public class ColorUtils
 
     return col;
   }
-  
-  public static boolean couldBeHexColor(String n) {
-    return (n.length() > 0 && "abcdefABCDEF".indexOf(n.charAt(0)) >= 0);
-  }
 
   /**
    * Constructs a colour from a text string. The hashcode of the whole string is
@@ -331,7 +329,7 @@ public class ColorUtils
       return null;
     }
     Color col = null;
-    name = name.toLowerCase();
+    name = name.toLowerCase(Locale.ROOT);
 
     // or make a static map; or use reflection on the field name
     switch (name)