{
return null;
}
- // SwingJS can do this natively. Not implemented here because that would
- // introduce capabilities into JalviewJS that are not in Jalview/Java.
- switch (name.toLowerCase())
+
+ /*
+ * JSUtil provides code that will convert any web colour name to the
+ * AWT color; but preferred solution is to add these colours for Java
+ * also (preferably read from a resource file).
+ * NB there are some conflicts (differing colours for the same name)
+ * - see JAL-3368
+ */
+ /**
+ * @j2sNative
+ *
+ * return swingjs.JSUtil.getColorFromName$S(name);
+ */
{
- case "black":
- return Color.black;
- case "blue":
- return Color.blue;
- case "cyan":
- return Color.cyan;
- case "darkgray":
- return Color.darkGray;
- case "gray":
- return Color.gray;
- case "green":
- return Color.green;
- case "lightgray":
- return Color.lightGray;
- case "magenta":
- return Color.magenta;
- case "orange":
- return Color.orange;
- case "pink":
- return Color.pink;
- case "red":
- return Color.red;
- case "white":
- return Color.white;
- case "yellow":
- return Color.yellow;
- default:
- return null;
+ switch (name.toLowerCase())
+ {
+ case "black":
+ return Color.black;
+ case "blue":
+ return Color.blue;
+ case "cyan":
+ return Color.cyan;
+ case "darkgray":
+ return Color.darkGray;
+ case "gray":
+ return Color.gray;
+ case "green":
+ return Color.green;
+ case "lightgray":
+ return Color.lightGray;
+ case "magenta":
+ return Color.magenta;
+ case "orange":
+ return Color.orange;
+ case "pink":
+ return Color.pink;
+ case "red":
+ return Color.red;
+ case "white":
+ return Color.white;
+ case "yellow":
+ return Color.yellow;
+ default:
+ return null;
+ }
}
}