package npw; import painter.SPainter; import shapes.SSquare; import java.awt.*; public class Stella { private static Color randomColor() { int rv = (int) (Math.random() * 256); int gv = (int) (Math.random() * 256); int bv = (int) (Math.random() * 256); return new Color(rv, gv, bv); } public static void main(String[] args) { // create the objects to think with SPainter miro = new SPainter("Stella", 800, 800); SSquare square = new SSquare(700); int x = 0; boolean color = true; Color color1 = randomColor(); Color color2 = randomColor(); while (x <= 10) { square.shrink(50); if (color == true) { miro.setColor(color1); miro.paint(square); color = false; } else if (color == false) { miro.setColor(color2); miro.paint(square); color = true; } x = x + 1; } } }