gradientElement.setAttribute("x2", String.valueOf(vector[2]));
gradientElement.setAttribute("y2", String.valueOf(vector[3]));
gradientElement.setId(gradient.getId());
getDefinitions().appendChild(gradientElement);
for (int i = 0; i < gradient.getStops().size(); i++) {
Stop stop = gradient.getStops().get(i);
Element stopEl = createSVGElement("stop");
stopEl.setAttribute("offset", String.valueOf(stop.getOffset()) + "%");
stopEl.setAttribute("stop-color", stop.getColor().toString());
stopEl.setAttribute("stop-opacity", String.valueOf(stop.getOpacity()));
gradientElement.appendChild(stopEl);
}
}