public static final ReadOnlyColorRGBA stringToColorRGBA(String str,ReadOnlyColorRGBA defaultColor){
  if ((str == null) || str.isEmpty()) {
    if (defaultColor == null) {
      throw new NullPointerException();
    }
    return (defaultColor);
  }
  try {
    float[] col=stringToFloatArray(str);
    if (col.length < 3) {
      return (defaultColor);
    }
    if (col.length == 3) {
      return (new ColorRGBA(col[0],col[1],col[2],1));
    }
 else {
      return (new ColorRGBA(col[0],col[1],col[2],col[3]));
    }
  }
 catch (  Exception e) {
    if (defaultColor == null) {
      throw new IllegalArgumentException(e);
    }
    return (defaultColor);
  }
}

public static final ReadOnlyColorRGBA stringToColorRGBA ( String str , ReadOnlyColorRGBA defaultColor ) { if ( ( str == null ) || str . isEmpty ( ) ) { if ( defaultColor == null ) { throw new NullPointerException ( ) ; } return ( defaultColor ) ; } try { float [ ] col = stringToFloatArray ( str ) ; if ( col . length < 3 ) { return ( defaultColor ) ; } if ( col . length == 3 ) { return ( new ColorRGBA ( col [ 0 ] , col [ 1 ] , col [ 2 ] , 1 ) ) ; } else { return ( new ColorRGBA ( col [ 0 ] , col [ 1 ] , col [ 2 ] , col [ 3 ] ) ) ; } } catch ( Exception e ) { if ( defaultColor == null ) { throw new IllegalArgumentException ( e ) ; } return ( defaultColor ) ; } }
convert a string to a colorrgba .
