code: private static Float  parseOpacity(String val)
     {
        try {
           float  o = parseFloat(val);
           return (o < 0f) ? 0f : (o > 1f) ? 1f : o;
        } catch (SVGParseException e) {
           return null;
        }
     }
docs: /*
  Parse an opacity value (a float clamped to the range 0..1).