+ if (bgcolourstring.charAt(0) == '#')
+ {
+ bgcolour = Color.decode(bgcolourstring);
+ }
+ else
+ {
+ Field field = Color.class.getField(bgcolourstring);
+ bgcolour = (Color) field.get(null);
+ }
+ } catch (IllegalArgumentException | NoSuchFieldException
+ | SecurityException | IllegalAccessException nfe)
+ {
+ Console.warn(
+ "Background colour string '" + bgcolourstring
+ + "' not recognised -- using black.");
+ bgcolour = Color.black;