@Override protected Widget createDialogArea() { final HorizontalPanel panel = new HorizontalPanel(); // the pickers slPicker = new SaturationLightnessPicker(); panel.add(slPicker); huePicker = new HuePicker(); panel.add(huePicker); // bind saturation/lightness picker and hue picker together huePicker.addHueChangedHandler( new IHueChangedHandler() { @Override public void hueChanged(final HueChangedEvent event) { slPicker.setHue(event.getHue()); } }); return panel; }
public void setColor(final String color) { final int[] rgb = ColorUtils.getRGB(color); final int[] hsl = ColorUtils.rgb2hsl(rgb); huePicker.setHue(hsl[0]); slPicker.setColor(color); }