Skip to content

Color Picker

Paweł Pastuszak edited this page Feb 16, 2015 · 10 revisions

Color Picker allows user to choose color. Picker was added in VisUI 0.6.0

Color Picker SS

User can chose new color using HSV or RGB system. He can also enter hex rgb value. User can change color alpha. In text fields user can press plus or minus numpad key to quickly increment or decrement field value. Pressing plus or minus key with left shift will change value by 10.

Color picker is a heavy widget and should be reused whenever possible, picker unlike other VisUI widgets must be disposed (by calling picker.dispose()) when no longer needed.

Usage:

ColorPicker picker = new ColorPicker(new ColorPickerAdapter() {
	@Override
	public void finished (Color newColor) {
		image.setColor(newColor);
	}
});

//...

showPickerButton.addListener(new ChangeListener() {
	@Override
	public void changed (ChangeEvent event, Actor actor) {
		getStage().addActor(picker.fadeIn());
	}
});