sclass Stripes implements MakesBufferedImage { int w, h; double angle; // radians new L colors; new DoubleList positionsInDirection; new pixelPositions; public BufferedImage getBufferedImage() { var img = newBufferedImage(w, h, first(colors)); var g = graphics(img); translateGraphics(g, w*.5, h*.5); rotateGraphicsClockwise_radians(g, angle); double bigNumber = (w+h)*2; int n = numberOfStripes(); for (int i = 0; i < n; i++) { double x1 = positionsInDirection.get(i); double x2 = getOr(positionsInDirection, i+1, bigNumber); Color color1 = or(cyclicGet(colors, i), Color.black); Color color2 = or(cyclicGet(colors, i+1), Color.white); g2.setPaint(new GradientPaint(x1, 0, color1, x2, 0, color2)); // TODO: Line2D.Double (full precision) g.fillPolygon(g, ll(pt_iround(x1, -bigNumber), pt_iround(x2, -bigNumber), pt_iround(x2, bigNumber), pt_iRound(x1, bigNumber)),); } ret img; } int numberOfStripes() { ret l(positionsInDirection)+1; } }