public static Color toColour(String hexString){
  Color colour=null;
  if ((hexString != null) && (hexString.length() == 7) && (hexString.startsWith("#"))) {
    String redSubString=hexString.substring(1,3);
    int red=Integer.parseInt(redSubString,16);
    String greeSubString=hexString.substring(3,5);
    int green=Integer.parseInt(greeSubString,16);
    String blueSubString=hexString.substring(5,7);
    int blue=Integer.parseInt(blueSubString,16);
    colour=new Color(red,green,blue);
  }
  return colour;
}

public static Color toColour ( String hexString ) { Color colour = null ; if ( ( hexString != null ) && ( hexString . length ( ) == 7 ) && ( hexString . startsWith ( "#" ) ) ) { String redSubString = hexString . substring ( 1 , 3 ) ; int red = Integer . parseInt ( redSubString , 16 ) ; String greeSubString = hexString . substring ( 3 , 5 ) ; int green = Integer . parseInt ( greeSubString , 16 ) ; String blueSubString = hexString . substring ( 5 , 7 ) ; int blue = Integer . parseInt ( blueSubString , 16 ) ; colour = new Color ( red , green , blue ) ; } return colour ; }
converts colour string to colour .
