void (Color color, Object source) { float[] hsb = new float[3]; Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsb); myBrightnessComponent.setValue(255 - (int)(hsb[2] * 255)); myBrightnessComponent.repaint(); myColorWheel.dropImage(); if (myOpacityComponent != null && source instanceof ColorPicker) { myOpacityComponent.setValue(color.getAlpha()); myOpacityComponent.repaint(); } myColorWheel.setColor(color, source); }