If you're able to get the numeric value of the selected color and parse it into a String
then you can call Color.decode() method.
For instance white color:
element.setBackground(Color.decode("077777777")); // octal format
element.setBackground(Color.decode("0xFFFFFF")); // hexa format
element.setBackground(Color.decode("16777215")); // decimal format
From javadoc:
public static Color decode(String nm)
throws NumberFormatException
Converts a String to an integer and returns the specified opaque
Color. This method handles string formats that are used to represent
octal and hexadecimal numbers.
Parameters:
nm
- a String that represents an opaque color as a 24-bit integer
Returns:
the new Color object.