/* This program draws an example of induced contrast to the screen.
 * 
 * Adam Tran
 * 9/26/08
 * 
 * This program is extended by ColorPanel.java
 * 
 */

import javax.swing.*;    
import java.awt.*;    

public class project413 {

   public static void main(String[] args){
	 JFrame theGUI = new JFrame();
	 theGUI.setTitle("Induced Contrast");
	 theGUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	 Container pane = theGUI.getContentPane();
	 int rows = 3;
	 int cols = 6;
	 pane.setLayout(new GridLayout(rows, cols)); // The drawing is 18 tiles, 3 deep and 6 across
	 for (int i = 1; i <= rows * cols; i++){ // Draw the eighteen tiles, like writing on a rage (L -> R)
		 int color = 0; // White by default
		 if (i % 7 > 3 || i % 6 == 0){ // Second three columns are black
			 color = 255;
		 }
		 if (i == 8 || i == 11){ //Eighth and eleventh tiles should be gray
			 color = 127;
		 }
		 Color backColor = new Color(color, color, color);
		 ColorPanel panel = new ColorPanel(backColor, 50, 50);
		 pane.add(panel);
	 }
	     theGUI.pack();
	     theGUI.setVisible(true);
   }
}
