email me at borlaj@portlandschools.org

Loading
notes previous (10/<10) submit the dump links  
 

Notes for - PaintBrush

Colors

 

If you wanted to setColor to another rgb color directly and the color is color:

 

g.setColor(new Color (233,33,61));

 

 

To deal with colors most easily, you may want to declare a variable of type Color, ie:

Color myColor;

 

And use this variable just like you would any other, ie:

if (x and y are in region)

myColor=Color.blue;

And then to set color you could do:

g.setColor(myColor);

 

 

To be more selective in your color choice you could pick color by RGB, see below:

Color myColor=new Color(125,15,150); // where 125,15,150 are the RGB values

 

 

 

To see RGB values, click here.