// test_colorfa.java compile javac -cp . test_colorfa.java // execute java -cp . test_colorfa import java.awt.*; import java.awt.event.*; public class test_colorfa extends Frame { colorf C = new colorf(); public test_colorfa() { System.out.println("test_colorfa.java running"); setTitle("test_colorfa.java"); setSize(300,650); setBackground(Color.white); setForeground(Color.black); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); setVisible(true); repaint(); System.out.println("test_colorfa.java finished"); } public void paint(Graphics g) { double RGB[] = new double[3]; double c = 0.0; g.drawString("c",20, 40); for(int i=0; i<20; i++) { C.colorf(c, RGB); System.out.println("colorf("+c+", RGB)="); System.out.println("RGB="+RGB[0]+" "+RGB[1]+" "+RGB[2]); g.setColor(new Color((float)RGB[0],(float)RGB[1],(float)RGB[2])); g.fillRect(160,(int)(50.0+522.0*c),100,25); g.setColor(Color.black); g.drawString(" "+(c),10,(int)(65.0+522.0*c)); c = c+0.05; } } public static void main (String[] args) { new test_colorfa(); } } // end test_colorfa.java