You can convert between Processing's use of integers to represent colours and Java's own
Color class though. That then allows you to manipulate the individual components without resorting to bit manipulation. It also gives you access to Java's colour methods such as conversion to HSB, interpretation of HTML style hex colours etc.
A simple example:
Quote:int myCol1, myCol2, myCol3;
void setup()
{
size(400,400);
smooth();
// Original Processing colour.
myCol1 = color(200,150,50,255);
// Create a Java Color object from Processing colour.
Color javaCol = new Color(myCol1);
// Darken Java colour and then convert to processing colour.
myCol2 = javaCol.darker().getRGB();
// Create processing colour with boosted green from Java colour components.
int r=javaCol.getRed();
int g=javaCol.getGreen();
int b=javaCol.getBlue();
int a=javaCol.getAlpha();
myCol3 = color(r/2,g,b/2,a);
}
void draw()
{
background(255);
fill(myCol1);
ellipse(width/2,height*.25,100,100);
fill(myCol2);
ellipse(width/2,height*.5,100,100);
fill(myCol3);
ellipse(width/2,height*.75,100,100);
}