public static final Color stringToColor(String str){
  if ((str == null) || str.isEmpty()) {
    return (null);
  }
  int[] col=stringToIntArray(str);
  if (col.length < 3) {
    return (null);
  }
  if (col.length == 3) {
    return (new Color(col[0],col[1],col[2]));
  }
 else {
    return (new Color(col[0],col[1],col[2],col[3]));
  }
}

public static final Color stringToColor ( String str ) { if ( ( str == null ) || str . isEmpty ( ) ) { return ( null ) ; } int [ ] col = stringToIntArray ( str ) ; if ( col . length < 3 ) { return ( null ) ; } if ( col . length == 3 ) { return ( new Color ( col [ 0 ] , col [ 1 ] , col [ 2 ] ) ) ; } else { return ( new Color ( col [ 0 ] , col [ 1 ] , col [ 2 ] , col [ 3 ] ) ) ; } }
convert a string to a color .
