import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import java.io.*;

public class Coloriage extends JComponent{

	public Coloriage(Color couleur){
		JFrame fenetre = new JFrame();
		fenetre.setLocation(100,100);
		fenetre.setSize(500,500);
		fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		fenetre.setVisible(true);
		try{
			FileOutputStream fos = new FileOutputStream("couleur.bin");
			int blue = couleur.getBlue();
            int red = couleur.getRed();
            int green = couleur.getGreen();
			for (int i= 0; i < 500; i++){
				fos.write(blue);
            	fos.write(red);
            	fos.write(green);
			}
			
		}catch(IOException e){
            System.err.println("erreur d'ecriture");
        }
	}
}