Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Layers In Java? Overlapping Colours Get Darker?

Hi,

I am wondering if there is any function to make layers in java. well at least that is the best way i can try to describe it...What i want to do, is with my applet, it consists of circles that are intersecting at one point, you can see my applet below for what it looks like. I want to be able to colour in every circle, easy enough, but when the circle overlapps another circle, i want that part to turn a shade darker, if you get what i mean...

Is this possible? how would i go about doing it if anyone knows?

Thanks!

import java.applet.*;
import java.awt.*;

public class Flower extends Applet {
double x, y;

public void paint(Graphics g) {

int n = 3;
double angle = 360 / n;
int radius = 100;
for (int i = 0; i < n; i++) {
double radians = angle/ 180 * Math.PI;
x = Math.cos(radians * i) * radius;
y = Math.sin(radians * i) * radius;
g.drawOval((int) x + radius, (int) y + radius, 2 * radius, 2 * radius);
}
}
}

-Crawf
[1147 byte] By [crawf] at [2007-11-11 8:48:39]