void (MouseEvent e) { final int x = e.getX(); final int y = e.getY(); int mx = myWheel.x + myWheel.width / 2; int my = myWheel.y + myWheel.height / 2; double s; double h; s = Math.sqrt((x - mx) * (x - mx) + (y - my) * (y - my)) / (myWheel.height / 2); h = -Math.atan2(y - my, x - mx) / (2 * Math.PI); if (h < 0) h += 1.0; if (s > 1) s = 1.0; setHSBValue((float)h, (float)s, myBrightness, myOpacity); }