Looping through RGB

hello

i am having some confusion over incrimenting the values of the RGB Colour obj in a loop, so far i hav been able to loop through 1 line of black to red. on the next line i want to change coulor creating a pallet.

I am printing 255 pixels per line whith an incrimentation in the coulour

This is what i got so far

public static void main(String[] args)

{

//********** input ****************************

int x = 10, y = 10;

int R = 0, G = 0, B = 0;

//*********************************************

//********** output ***************************

GrafixDrawingFrame f = Grafix.out;

for(int i=0; i<255; i++){

x = 10;

for(int I=0; I<255; I++){

f.setColor(new Color(R, G, B));

f.fillRect(x, y, 1, 1);

x = x + 1;

R = R + 1;

G = G + 0;

B = B + 0;

}

y = y + 1;

}

//*********************************************

}

[969 byte] By [nadeemshafi9a] at [2007-10-2 12:43:53]
# 1
http://forum.java.sun.com/thread.jspa?forumID=426&threadID=685392See reply 9.There are many color pallets. Perhaps provide a link to one that you want to create. JColorChooser also has a color pallet.
rkippena at 2007-7-13 9:50:57 > top of Java-index,Other Topics,Algorithms...