// Path: main/java/Vexillo/src/com/kreative/vexillo/core/Color.java
// public interface HasRGB {
// 	public int getRGB();
// }


import java.awt.BasicStroke;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.AffineTransform;
import java.awt.geom.Area;
import java.awt.geom.Line2D;
import java.awt.geom.PathIterator;
import java.awt.geom.Rectangle2D;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.kreative.vexillo.core.Color.HasRGB;
				Color color2 = flag.colors().get(gi.color2);
				if (color1 instanceof HasRGB && color2 instanceof HasRGB) {
					String gradId = "grad" + (next[GRAD_ID]++);
					int c1 = ((HasRGB)color1).getRGB();
					int c2 = ((HasRGB)color2).getRGB();
					defs.add("<linearGradient id=\"" + gradId + "\" y1=\"0%\" y2=\"100%\" x1=\"0%\" x2=\"0%\">");
					defs.add("<stop offset=\"0%\" stop-color=\"rgb(" + ((c1 >> 16) & 0xFF) + "," + ((c1 >> 8) & 0xFF) + "," + (c1 & 0xFF) + ")\"/>");
					defs.add("<stop offset=\"100%\" stop-color=\"rgb(" + ((c2 >> 16) & 0xFF) + "," + ((c2 >> 8) & 0xFF) + "," + (c2 & 0xFF) + ")\"/>");
					defs.add("</linearGradient>");
					g.add(
						"<rect x=\"" + svgRound(x1) + "\" y=\"" + svgRound(y1) + "\"" +
						" width=\"" + svgRound(x2-x1) + "\" height=\"" + svgRound(y2-y1) + "\"" +
						" fill=\"url(#" + gradId + ")\"/>"
					);
				}
			}
		} else if (i instanceof Instruction.VGradInstruction) {
			Instruction.VGradInstruction gi = (Instruction.VGradInstruction)i;
			double x1 = gi.x1.value(d);
			double y1 = gi.y1.value(d);
			double x2 = gi.x2.value(d);
			double y2 = gi.y2.value(d);
			if (clip) {
				g.add(
					"<rect x=\"" + svgRound(x1) + "\" y=\"" + svgRound(y1) + "\"" +
					" width=\"" + svgRound(x2-x1) + "\" height=\"" + svgRound(y2-y1) + "\"/>"
				);
			} else {
				Color color1 = flag.colors().get(gi.color1);
				Color color2 = flag.colors().get(gi.color2);
// Path: main/java/Vexillo/src/com/kreative/vexillo/core/Color.java
// public interface HasRGB {
// 	public int getRGB();
// }


// Path: main/java/Vexillo/src/com/kreative/vexillo/core/SVGExporter.java
import java.awt.BasicStroke;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.AffineTransform;
import java.awt.geom.Area;
import java.awt.geom.Line2D;
import java.awt.geom.PathIterator;
import java.awt.geom.Rectangle2D;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.kreative.vexillo.core.Color.HasRGB;

				Color color2 = flag.colors().get(gi.color2);
				if (color1 instanceof HasRGB && color2 instanceof HasRGB) {
					String gradId = "grad" + (next[GRAD_ID]++);
					int c1 = ((HasRGB)color1).getRGB();
					int c2 = ((HasRGB)color2).getRGB();
					defs.add("<linearGradient id=\"" + gradId + "\" y1=\"0%\" y2=\"100%\" x1=\"0%\" x2=\"0%\">");
					defs.add("<stop offset=\"0%\" stop-color=\"rgb(" + ((c1 >> 16) & 0xFF) + "," + ((c1 >> 8) & 0xFF) + "," + (c1 & 0xFF) + ")\"/>");
					defs.add("<stop offset=\"100%\" stop-color=\"rgb(" + ((c2 >> 16) & 0xFF) + "," + ((c2 >> 8) & 0xFF) + "," + (c2 & 0xFF) + ")\"/>");
					defs.add("</linearGradient>");
					g.add(
						"<rect x=\"" + svgRound(x1) + "\" y=\"" + svgRound(y1) + "\"" +
						" width=\"" + svgRound(x2-x1) + "\" height=\"" + svgRound(y2-y1) + "\"" +
						" fill=\"url(#" + gradId + ")\"/>"
					);
				}
			}
		} else if (i instanceof Instruction.VGradInstruction) {
			Instruction.VGradInstruction gi = (Instruction.VGradInstruction)i;
			double x1 = gi.x1.value(d);
			double y1 = gi.y1.value(d);
			double x2 = gi.x2.value(d);
			double y2 = gi.y2.value(d);
			if (clip) {
				g.add(
					"<rect x=\"" + svgRound(x1) + "\" y=\"" + svgRound(y1) + "\"" +
					" width=\"" + svgRound(x2-x1) + "\" height=\"" + svgRound(y2-y1) + "\"/>"
				);
			} else {
				Color color1 = flag.colors().get(gi.color1);
				Color color2 = flag.colors().get(gi.color2);
				if (color1 instanceof HasRGB && color2 instanceof HasRGB) {