// (c) 1998 duane a. bailey import java.awt.Color; import element.*; public class ColorDemo { static DrawingWindow d; static void explain(java.awt.Color cl) { System.out.println("R="+(cl.getRed()/255d)); System.out.println("G="+cl.getGreen()/255d); System.out.println("B="+cl.getBlue()/255d); System.out.println(); } public static void main(String args[]) { // draw mystic symbol d = new DrawingWindow(); d.hold(); // draw half-gray, half-black circle d.setForeground(Color.black); d.fill(new Arc(50,50,100,100,90,180)); d.setForeground(Color.gray); d.fill(new Arc(50,50,100,100,-90,180)); // add upper and lower discs d.setForeground(Color.black); d.fill(new Oval(75,50,50,50)); d.setForeground(Color.gray); d.fill(new Oval(75,100,50,50)); /* This part, below, commented out. // draw mystic symbol d = new DrawingWindow(); d.hold(); d.setForeground(Color.black); d.setBackground(Color.gray); // draw half-black (fill), half-gray (clear) circle d.fill(new Arc(50,50,100,100,90,180)); d.clear(new Arc(50,50,100,100,-90,180)); // add upper and lower discs d.fill(new Oval(75,50,50,50)); d.clear(new Oval(75,100,50,50)); */ d.release(); } }